Check if the given field is valid or not.

@return boolean
162782
public function isValid()
    {
        // these schemes are allowed
        $allowedSchemes = $this->getAllowedSchemes();

        // get the field value
        $url = $this->field->getValue();


        // not required and empty? Then its valid
        if ($this->isNotRequiredAndEmpty($url)) {
            return true;
        }

        if ($this->getMaxLength() && strlen($url) > $this->getMaxLength()) {
            // Over maximum length.
            return false;
        }

        // do simple validation
        if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED | FILTER_FLAG_SCHEME_REQUIRED)) {
            return false;
        }

        // check if we have a tld
        if (!$this->isSkipTldCheck() && !preg_match('#\.[a-z]{2,}$#', parse_url($url, PHP_URL_HOST))) {
            return false;
        }

        // further validation is required.
        if (in_array(parse_url($url, PHP_URL_SCHEME), $allowedSchemes)) {
            return true;
        }

        return false;
    }
764101
public function isValid()
    {
        try {
            $this->validateName($this->name);
            $this->validateValue($this->value);
            $this->validateMaxAge($this->maxAge);
        } catch (\InvalidArgumentException $e) {
            return false;
        }

        return true;
    }
1258487
public function isValid()
    {
        $this->applyFilters();

        $this->validationMessage = null;

        foreach ($this->validators as $validator) {
            if (!$validator->isValid($this->translations)) {
                $this->validationMessage = $validator->getMessage();
                return false;
            }
        }

        return true;
    }
655980
public function valid()
	{
		$valid = false;

		if ($this->rows && $this->count())
		{
			$key   = key($this->rows);
			$valid = ($key !== null && $key !== false);
		}

		return $valid;
	}
514708
public function valid()
    {
        $isValid = $this->isFlagSet(self::STATUS_VALID);
        $subscriptionFlags = self::STATUS_SUBSCRIBED | self::STATUS_PSUBSCRIBED;
        $hasSubscriptions = ($this->statusFlags & $subscriptionFlags) > 0;

        return $isValid && $hasSubscriptions;
    }
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);
        }
    }
6257
public function isValid()
    {
        $blnReturn = true;

        $intDynamicCount = $this->getDynamicCount();

        for ($intCount = 0; $intCount <= $intDynamicCount; $intCount ++) {
            $blnReturn = $this->__validate($intCount);

            if (! $blnReturn) {
                break;
            }
        }

        return $blnReturn;
    }
933878
public function validate() {
        if (!$this->_data) {
            return false;
        }

        $fields = $this->getFields();
        $messages = $this->getMessages();

        foreach ($this->_data as $field => $value) {
            if (empty($this->_rules[$field])) {
                continue;
            }

            foreach ($this->_rules[$field] as $rule => $params) {
                $options = $params['options'];
                $arguments = $options;
                array_unshift($arguments, $value);

                // Use G11n if it is available
                if (class_exists('Titon\G11n\Utility\Validate')) {
                    $class = 'Titon\G11n\Utility\Validate';
                } else {
                    $class = 'Titon\Utility\Validate';
                }

                if (!call_user_func(array($class, 'hasMethod'), $rule)) {
                    throw new InvalidValidationRuleException(sprintf('Validation rule %s does not exist', $rule));
                }

                // Prepare messages
                $message = $params['message'];

                if (!$message && isset($messages[$rule])) {
                    $message = $messages[$rule];
                }

                if ($message) {
                    $message = String::insert($message, array_map(function($value) {
                        return is_array($value) ? implode(', ', $value) : $value;
                    }, $options + array(
                        'field' => $field,
                        'title' => $fields[$field]
                    )));
                } else {
                    throw new InvalidValidationRuleException(sprintf('Error message for rule %s does not exist', $rule));
                }

                if (!call_user_func_array(array($class, $rule), $arguments)) {
                    $this->addError($field, $message);
                    break;
                }
            }
        }

        return empty($this->_errors);
    }
155192
public function isValid() : bool
   {

      if ( $this->_support->hasAttribute( $this->_requiredAttributeName ) )
      {
         return true;
      }

      return $this->_support->hasAttribute( $this->_altAttributeName );

   }
879185
public function isValid()
    {
        // if this token was not validated before...
        if ($this->validated === null) {
            // get the token value
            $token = $this->field->getValue();

            if (!empty($_SESSION) && !empty($_SESSION['csrftokens'])) {
                // if the token is in the list of valid tokens, this field is valid!
                $key = array_search($token, $_SESSION['csrftokens']);
                if ($key !== false) {
                    // invalidate the token as it has already been used.
                    unset($_SESSION['csrftokens'][$key]);

                    $this->validated = true;
                } else {
                    $this->validated = false;
                }
            } else {
                $this->validated = false;
            }
        }

        return $this->validated;
    }
1040684
public function validate()
    {
        $this->_errors = [];
        $success = true;
        foreach ($this->fields as $name => $field) {
            /** @var $field Field */
            if (!$field->validate($this, $this->getExtraValidatorFor($name))) {
                $success = false;
            }
        }

        return $success && count($this->_errors) === 0;
    }
867896
public function valid(): bool
    {
        $key = key($this->collection);

        return $key !== null && $key !== false;
    }
315552
public function isValid()
    {
        $filtered = $this->getValue();
        $valid = $this->getValidatorChain()->isValid($filtered);
        $this->_messages = $this->getValidatorChain()->getMessages();
        return $valid;
    }
932048
public function validate()
    {
        $errors = [];

        foreach ($this->fields as $field) {
            $result = $field->validate();

            if ($result->isFailure()) {
                $errors[] = $result;
            }
        }

        if ($errors) {
            $this->setErrors($errors);

            return false;
        }

        return true;
    }
527138
public function validated($field = null, $default = false)
	{
		if ($field === null)
		{
			return $this->validated;
		}

		return array_key_exists($field, $this->validated) ? $this->validated[$field] : $default;
	}
1066364
public function isValid()
    {
        if ($this->valid === null) {
            $this->valid = true;

            if (sizeof($this->validators) > 0) {
                foreach ($this->validators as $validator) {
                    if (!$validator->isValid()) {
                        $this->errors[] = $validator->getErrorMessage();
                        $this->valid = false;
                    }
                }
            }
        }

        return $this->valid;
    }
1085324
public function isValid() {
		
		$value = $this -> getValue();

		if(true === $this -> getValidateAsArray() && true === is_array($value)) {
			
			foreach($value as $val) {

				if(false === $this -> check($val)) {
					return false;
				}
			}
		}
		else {
			return $this -> check($value);
		}

		return true;
	}