The value must match one of a given set of validators.
@param array $validators The possible validators to use.
@return Schemer\Validator\Any
181786
public static function oneOf(array $validators) : Validator\Any
    {
        return self::any()->should(
            function ($value) use ($validators) : bool {
                foreach ($validators as $validator) {
                    if (!$validator->validate($value)->isError()) {
                        return true;
                    }
                }

                return false;
            },
            'matches none of the options'
        );
    }
1196813
private static function checkClass($validator)
    {
        if (! class_exists($validator)) {
            throw new InvalidArgumentException(
                "Class {$validator} does not exists."
            );
        }

        if (! is_subclass_of($validator, ValidatorInterface::class)) {
            throw new Exception\UnknownValidatorClassException(
                "The validator '{$validator}' is not defined or does not " .
                "implements the Slick\\Validator\\ValidatorInterface interface"
            );
        }

        return $validator;
    }
302318
protected function checkProperty($value, $validators)
    {
        $result = null;
        foreach ($validators as $validator) {
            if ($validator instanceof ObjectValidatorInterface) {
                $validator->setValidatedInstancesContainer($this->validatedInstancesContainer);
            }
            $currentResult = $validator->validate($value);
            if ($currentResult->hasMessages()) {
                if ($result === null) {
                    $result = $currentResult;
                } else {
                    $result->merge($currentResult);
                }
            }
        }
        return $result;
    }
1372645
def _validators(self):
		""""""
		
		for validator in self.__validators__.values():
			yield validator
		
		if self.validators:
			for validator in self.validators:
				yield validator
914515
public function getFlattenValidators()
    {
        if (!$this->exists) {
            return [];
        }

        $validators = $this->validators;
        $return     = [];
        if (!empty($validators)) {
            foreach ($validators as $validator) {
                $return[$validator->validator_id] = $validator->value;
            }
        }
        return $return;
    }
641350
public function extend($validator)
	{
		$validator = is_array($validator) ? $validator : [$validator];

		$this->validators = array_merge($this->validators, $validator);

		return $this;
	}
91560
public static function validator($validator = null)
    {
        if (func_num_args()) {
            static::$_validators[static::class] = $validator;
            return;
        }
        $self = static::class;
        if (isset(static::$_validators[$self])) {
            return static::$_validators[$self];
        }
        $class = static::$_classes['validator'];
        $validator = static::$_validators[$self] = new $class();
        static::_rules($validator);
        return $validator;
    }
1158687
public function setValidator(Validator $validator)
    {
        $this->validator = $validator;
        
        $validator->configureRule($this);
        
        return $this;
    }
1260119
public function addValidator($validator)
    {
        if (!$validator instanceof ValidatorInterface) {
            if (!is_callable($validator)) {
                throw new \InvalidArgumentException('Validator should be callable or ValidatorInterface.');
            }

            $validator = new CallbackValidator($validator);
        }

        $this->validators[] = $validator;

        return $this;
    }
1309498
public function setValidator(Validator $validator)
    {
        if ($validator) {
            $this->validator = $validator;
            $this->validator->setForm($this);
        }
        return $this;
    }
499960
protected function useValidator(Validator $validator)
    {
        if ($validator !== $this->validator9) {
            return true;

        }
        $set1 = substr($this->account, 0, 2);
        $set2 = substr($this->account, 0, 3);
        return ($set1 >= 51  && $set1 <= 59)
            || ($set2 >= 901 && $set2 <= 910);
    }
1348814
public function withErrors($validator)
    {
        foreach ($validator->errors() as $key => $value) {
            if (count($value) > 1) {
                for ($i = 0; $i < count($value); $i++) {
                    $data[$key][$i] = $value[$i];
                }
            } else {
                $data[$key] = $value[0];
            }
            $this->_errors->add((object) $data);
        }

        $this->_session->flash('errors', $this->_errors->all());

        return $this;
    }
575968
public function validate(array $values, array $rules)
    {
        // Assume no validation and result success
        $result = true;

        if (true !== $valid = $this->validateByRules($rules, $values)) {
            foreach ($valid as $componentName => $error) {
                $this->setError($error, $componentName);
            }

            // Set general form error
            $this->setError(
                [
                    'error' => 'general',
                    'info'  => [],
                ],
                Doozr_Form_Service_Constant::ERROR_IDENTIFIER_FORM
            );

            $result = false;
        }

        return $result;
    }
1089826
public function getValidationMessages($validator = null)
    {
        if ($validator) {
            return isset($this->validationMessages[$validator]) ? $this->validationMessages[$validator] : null;
        }

        return $this->validationMessages;
    }
75778
public function validate($validator)
    {
        $this->value = trim($this->value);

        $pattern = '^[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$';

        // Escape delimiter characters.
        $safePattern = str_replace('/', '\\/', $pattern);

        if ($this->value && !preg_match('/' . $safePattern . '/i', $this->value)) {
            $validator->validationError(
                $this->name,
                _t('SilverStripe\\Forms\\EmailField.VALIDATION', 'Please enter an email address'),
                'validation'
            );

            return false;
        }

        return true;
    }
25901
public function loadValidatorsFrom(array $validatorsInformation)
    {
        foreach ($validatorsInformation as $name => $validatorInfo) {
            $this->validateInputWith(
                $name,
                $validatorInfo['callback'],
                $validatorInfo['soundOnError']
            );
        }
        return $this;
    }
502582
public function validate(AbstractValidator $validator, $removeRequired = false, array $messages = [], array $customAttributes = [])
    {
        return $validator->validate($removeRequired);
        /*try {
            return $validator->validate($removeRequired);
        } catch (ValidationException $e) {
            $this->throwValidationException($e->getErrors());
        }*/

//              $this->throwValidationException($request, $validator);
        // $validator = $this->getValidationFactory()->make($request->all(), $rules, $messages, $customAttributes);

    }