public function validation($data, $files) {
        $errors = parent::validation($data, $files);
        if (count($errors) === 0 && !isset($data['sharing'])) {
            // They must select at least one sharing option.
            $errors['sharing'] = get_string('sharingrequired', 'cache');
        }
        return $errors;
    }
public function validation($data, $files) {
        $errors = parent::validation($data, $files);
        if (count($errors) === 0 && !isset($data['sharing'])) {
            // They must select at least one sharing option.
            $errors['sharing'] = get_string('sharingrequired', 'cache');
        }
        return $errors;
    }
public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( count ( $ errors ) === 0 && ! isset ( $ data [ 'sharing' ] ) ) { // They must select at least one sharing option. $ errors [ 'sharing' ] = get_string ( 'sharingrequired' , 'cache' ) ; } return $ errors ; }
Validates this form

@param array $data
@param array $files
@return array
Validates this form