Filter list by whether a user is validated or not.

@param bool $isValidated
496905
public function filterByIsValidated($isValidated)
    {
        $this->includeInactiveUsers();
        if (!$isValidated) {
            $this->includeUnvalidatedUsers();
            $this->query->andWhere('u.uIsValidated = :uIsValidated');
            $this->query->setParameter('uIsValidated', $isValidated);
        }
    }
688588
public function validate( $vars = null ) {
		$vars = $vars ?: $_POST;
		$this->values = [];
		$this->errors = [];
		$arrayInvalids = [];

		$cleaned = filter_var_array( $vars, $this->params );

		foreach ( $this->params as $name => $opt ) {
			$clean = isset( $vars[$name] ) ? $cleaned[$name] : null;

			if ( $clean === false &&
				$opt['filter'] !== \FILTER_VALIDATE_BOOLEAN
			) {
				$this->values[$name] = null;

			} elseif ( is_array( $clean ) &&
				( $opt['flags'] & \FILTER_REQUIRE_ARRAY ) &&
				$opt['filter'] !== \FILTER_VALIDATE_BOOLEAN
			) {
				// Strip invalid value markers from input array
				$this->values[$name] = [];
				foreach ( $clean as $key => $value ) {
					if ( $opt['filter'] !== \FILTER_VALIDATE_BOOLEAN &&
						$value !== false
					) {
						$this->values[$name][$key] = $value;

					} elseif ( $opt['filter'] === \FILTER_VALIDATE_BOOLEAN &&
						$value !== null
					) {
						$this->values[$name][$key] = $value;

					} else {
						// Keep track of invalid keys in case input was
						// required
						if ( !isset( $arrayInvalids[$name] ) ) {
							$arrayInvalids[$name] = [];
						}
						$arrayInvalids[$name][] = "{$name}[{$key}]";
					}
				}

			} else {
				$this->values[$name] = $clean;
			}

			if ( $opt['required'] && $this->values[$name] === null ) {
				$this->errors[] = $name;

			} elseif ( $opt['required'] && isset( $arrayInvalids[$name] ) ) {
				$this->errors = array_merge(
					$this->errors, $arrayInvalids[$name]
				);

			} elseif ( is_callable( $opt['validate'] ) &&
				call_user_func( $opt['validate'], $this->values[$name] ) === false
			) {
				$this->errors[] = $name;
				$this->values[$name] = null;
			}
		}

		$this->customValidationHook();

		return count( $this->errors ) === 0;
	}
1029891
protected function setValid($valid)
    {
        if (!isset($this->valid) || true === $this->valid) {
            $this->valid = $valid;
        }

        return $this;
    }
41723
public function validate(): bool
    {
        foreach ($this as $element) {
            if ($element instanceof HasValueValidationInterface) {
                $element->validate();
            }
        }
        return $this->errors()->empty();
    }
681288
public function setValid($charset, $valid = true)
    {
        $charset = Horde_String::upper($charset);
        $valid = (bool)$valid;

        if (!isset($this->_charsets[$charset]) ||
            ($this->_charsets[$charset] !== $valid)) {
            $this->_charsets[$charset] = $valid;
            $this->notify();
        }
    }
1079332
public function checkUse(bool $is_validated = false): bool
    {
        ++$this->is_used;
        $this->is_validated = $is_validated;
        if (!$this->save()) {
            throw new Exception(\Yii::t('app', 'Ошибка при сохранении статуса кода'));
        }
        return true;
    }
181606
public function validate(ValidationResult $validationResult)
    {
        $validator = new SynonymValidator(array(
            'SearchSynonyms',
        ));

        $validator->php(array(
            'SearchSynonyms' => $this->owner->SearchSynonyms
        ));

        $errors = $validator->getErrors();

        if (is_array($errors) || $errors instanceof Traversable) {
            foreach ($errors as $error) {
                $validationResult->addError($error['message']);
            }
        }
    }
570695
protected function _setValidationErrors($errorList)
    {
        if (!is_null($errorList)) {
            $errorList = $this->_normalizeIterable($errorList);
        }

        $this->validationErrors = $errorList;
    }
659039
public function isValid()
    {
        $rules    = [];
        $isValid  = true;
        $messages = [];

        foreach ($this->rules() as $fieldName => $spec) {
            $value = $this->post($fieldName);

            foreach ($spec as $specRules => $message) {
                if (!isset($rules[ $fieldName ])) {
                    $rules[ $fieldName ] = Rule::$specRules();
                } else {
                    $rules[ $fieldName ] = $rules[ $fieldName ]->$specRules();
                }

                if (!$rules[ $fieldName ]->validate($value)) {
                    $isValid                = false;
                    $messages[ $fieldName ] = $message;
                    break;
                }

                if (!in_array($fieldName, $this->validValues)) {
                    $this->validValues[ ] = $fieldName;
                }
            }
        }

        if (!$isValid || $this->session->getErrorsBag()->has()) {
            foreach ($messages as $name => $errors) {
                $this->session->getErrorsBag()->add($name, $errors);
            }
            throw new ValidationError($messages);
        }
    }
104528
public function setFilter($filter)
    {
        parent::setFilter($filter);

        $this->userOptions['value'] = $this->validator->arrayGet($filter, 'value', '');

        //if it isn't null, we have to check the 'true'/'false' string
        if ($this->userOptions['value'] !== '') {
            $this->userOptions['value'] = $this->userOptions['value'] === 'false' || !$this->userOptions['value'] ? 0 : 1;
        }
    }
945257
public function validate($value)
  {
    $this->reset();

    $this->value = $value;

    $this->validateRequired();
    $this->validateFilters();

    return $this->isValid();
  }
638376
protected function validateFilters()
  {
    if (!empty($this->value) && !empty($this->filters)) {
      foreach ($this->filters as $filter) {
        if (is_array($this->value) && $this->isMultipleChoiceAllowed()) {
          $this->value = Filter::Arr($this->value, $filter, null);

          $bad = empty($this->value);
        } else {
          $bad = is_null(Filter::Value($this->value, $filter, null));
        }

        if ($bad) {
          $this->addError(sprintf($this->tmpl_err_wrong, $this->getName()));

          return false;
        }
      }
    }

    return true;
  }
97483
public function isValid($sendHeaders = true)
    {
        if (Application::getInstance()->runningInConsole()) {
            return !$this->validator->with($this->inputs)->fails();
        }

        return $this->formBuilder->isValid($sendHeaders);
    }
655326
private function isValidRequestedUserInfo(array $requestedUserInfo): void
    {
        $allowedUserInfo = $this->getAllowedUserInfo();
        foreach ($requestedUserInfo as $userInfo) {
            if (!\in_array($userInfo, $allowedUserInfo, true)) {
                throw new InvalidKeyException(sprintf(
                    '%s is not a valid value. Valid values are "%s".',
                    $userInfo,
                    implode(', ', $allowedUserInfo)
                ));
            }
        }
    }
1362162
protected function _checkNoSelected(array $options, array $selected, $isMultiply = false)
    {
        if ($isMultiply === 'multiple') {
            return array($options, $selected);
        }

        $_selected = array_pop($selected);

        if (!Arr::key($_selected, $options) && !empty($selected)) {
            $options = array_merge(array($_selected => $this->_translate('--No selected--')), $options);
        }

        return array($options, array($_selected));
    }
572362
private static function validateFilter($filterBy = [])
    {
        // Components of $filterBy that will not be ignored
        $filterParams = [
            'agent_name',
            'agent_type',
            'device_type',
            'os_name',
            'os_type',
        ];

        $outputFilter = [];

        foreach ($filterParams as $field) {
            if (!empty($filterBy[$field])) {
                $outputFilter[$field] = $filterBy[$field];
            }
        }

        return $outputFilter;
    }
535422
private function getValidatedFilters(): iterable
    {
        $ruleIndexes = $this->serializerClass::readFilterRulesIndexes($this->getSerializedRuleSet());

        if ($ruleIndexes === null) {
            // without validation
            foreach ($this->getFilterParameters() as $field => $operationsWithArgs) {
                yield $field => $this->parseOperationsAndArguments(static::PARAM_FILTER, $operationsWithArgs);
            }
        } else {
            // with validation
            $mainIndexes = $this->serializerClass::readRuleMainIndexes($ruleIndexes);
            $this->validationStarts(static::PARAM_FILTER, $ruleIndexes);
            foreach ($this->getFilterParameters() as $field => $operationsWithArgs) {
                if (is_string($field) === false || empty($field) === true ||
                    is_array($operationsWithArgs) === false || empty($operationsWithArgs) === true
                ) {
                    throw new InvalidQueryParametersException($this->createParameterError(
                        static::PARAM_FILTER,
                        $this->getInvalidParamMessage()
                    ));
                }

                if (array_key_exists($field, $mainIndexes) === false) {
                    // unknown field set type
                    $this->getValidationErrors()->add(
                        new ValidationError(
                            static::PARAM_FILTER,
                            $field,
                            ErrorCodes::INVALID_VALUE,
                            Messages::INVALID_VALUE,
                            []
                        )
                    );
                } else {
                    // for field a validation rule is defined so input value will be validated
                    $ruleIndex = $mainIndexes[$field];
                    $parsed    = $this->parseOperationsAndArguments(static::PARAM_FILTER, $operationsWithArgs);

                    yield $field => $this->validateFilterArguments($ruleIndex, $parsed);
                }
            }
            $this->validateEnds(static::PARAM_FILTER, $ruleIndexes);
        }
    }