Verify if the model is valid by running its validation rules,
defined on attribute `$rules`.

@return bool
174796
public function isValid()
    {
        if (!$rules = $this->rules()) {
            return true;
        }

        $attributes = $this->getAttributes();

        // Verify attributes that are hashed and that have not changed
        // those doesn't need to be validated.
        foreach ($this->hashedAttributes as $hashedAttr) {
            if (isset($this->original[$hashedAttr]) && $this->$hashedAttr == $this->original[$hashedAttr]) {
                unset($rules[$hashedAttr]);
            }
        }

        // Creates validator with attributes and the rules of the object
        $validator = app(ValidationFactory::class)->make($attributes, $rules, $this->messages());

        // Validate and attach errors
        if ($hasErrors = $validator->fails()) {
            $this->errors = $validator->errors();
        }

        return !$hasErrors;
    }
192612
protected function validate()
    {
        $this->data = $this->module->getInfo($this->module_id);

        if (empty($this->data)) {
            $this->error = $this->translation->text('Failed to read module @id', array('@id' => $this->module_id));
            return false;
        }

        try {
            $this->module_model->checkCore($this->data);
            $this->module_model->checkPhpVersion($this->data);
            return true;
        } catch (Exception $ex) {
            $this->error = $ex->getMessage();
            return false;
        }
    }
910636
public function validate()
	{
		$validity = Rules::validate($this->attributes, $this->getRules());

		if ($validity === true)
		{
			return true;
		}

		$this->setErrors($validity);
		return false;
	}
1289778
public function hasValidator($validators, $attribute)
    {
        $validators = is_array($validators) ? $validators : [$validators];

        foreach ($this->rules() as $rule){
            $attributes = is_array($rule[0]) ? $rule[0] : [$rule[0]];
            if(in_array($attribute, $attributes) && in_array($rule[1], $validators)){
                return true;
            }
        }

        return false;
    }
1080002
public function checkRules($rules, Array $params = null)
    {
        if (is_string($rules)) {
            $rules = (array)explode(',', $rules);
        }

        foreach ($rules as $name) {
            if (!$this->hasRule($name) || !$this->getRule($name)->execute($this, $params)) {
                return false;
            }
        }

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

        return true;
    }
427030
public function hasError()
    {
        if (empty($this->validation_errors)) {
            return false;
        }
        foreach ($this->validation_errors as $v) {
            foreach ($v as $w) {
                if ($w) {
                    return true;
                }
            }
        }
        return false;
    }
545675
public function isValid()
	{
		$isValid = true;

		$form = $this->getForm();

		foreach($this->recordColumnsGet() as $column => $value)
		{
			$element = $form->getElement($column);
			if($element && !$element->isValid($value))
			{
				$isValid = false;
				$this->_validationErrors[$element->getId()] = $element->getErrors();
			}
		}

		return $isValid;
	}
717544
public function valid()
    {
        if ($this->container['characterId'] === null) {
            return false;
        }
        if ($this->container['joinTime'] === null) {
            return false;
        }
        if ($this->container['role'] === null) {
            return false;
        }
        $allowed_values = ["fleet_commander", "wing_commander", "squad_commander", "squad_member"];
        if (!in_array($this->container['role'], $allowed_values)) {
            return false;
        }
        if ($this->container['roleName'] === null) {
            return false;
        }
        if ($this->container['shipTypeId'] === null) {
            return false;
        }
        if ($this->container['solarSystemId'] === null) {
            return false;
        }
        if ($this->container['squadId'] === null) {
            return false;
        }
        if ($this->container['takesFleetWarp'] === null) {
            return false;
        }
        if ($this->container['wingId'] === null) {
            return false;
        }
        return true;
    }
41723
public function validate(): bool
    {
        foreach ($this as $element) {
            if ($element instanceof HasValueValidationInterface) {
                $element->validate();
            }
        }
        return $this->errors()->empty();
    }
47991
public function validates()
	{
		if ( ! isset(static::$_rules) or count(static::$_rules) < 0)
		{
			return true;
		}

		$vars = $this->_data;

		// Set default if there are any
		isset(static::$_defaults) and $vars = $vars + static::$_defaults;
		$vars = $this->pre_validate($vars);

		return $this->run_validation($vars);
	}
313837
public function isValid()
    {
        $this->errorMessages = [];
        $this->validatorCollection->rewind();
        while ($this->validatorCollection->valid()) {
            $this->checkForErrors($this->validatorCollection->current());
            $this->validatorCollection->next();
        }
        $count = count($this->errorMessages);
        return $count == 0;
    }
1100171
public function validate(){
        if(count($this->fieldsState) == 0){
            //Si no hay datos devuelve TRUE
            return TRUE;
        }
        else{
            //Si hay datos valida sus reglas            
            //El formulario empieza siendo valido
            $form_valid= TRUE;            
            //Recorro todos los datos y sus reglas
            foreach ($this->fieldsState as $fieldState) {
                $valid= TRUE;                
                //Recorro cada regla del dato
                foreach ($fieldState['rules'] as $rule) {
                    //Ve el tipo de regla, con o sin parametros
                    if (count(explode('[', $rule)) > 1){
                        //Si hay reglas con parametros, separa la regla y su parametro               
                        $vars= explode('[', $rule);
                        $rule= $vars[0];
                        $var= explode(']', $vars[1]);
                        $var= $var[0];
                        //Realiza el llamado a la funcion correspondiente
                        $valid= call_user_func_array(array($this, $rule), array($fieldState['name'], $fieldState['value'], $var));
                    }
                    else{
                        //Regla sin parametros
                        //Realiza el llamado a la funcion correspondiente
                        $valid= call_user_func_array(array($this, $rule), array($fieldState['name'], $fieldState['value']));
                    }
                    
                    //Si una regla ya no es valida, no reviso las demas
                    if(!$valid){
                        //Asigno al campo Valido del dato FALSE
                        $name= $fieldState['name'];
                        $this->fieldsState["$name"]['valid']= FALSE;
                        break;
                    }
                }                
                //Actualizo el valor de formulario_valido de manera que si ya es falso se mantiene en falso
                $form_valid= $form_valid && $valid;
            }            
            return $form_valid;
        }
    }
351482
public function hasErrors() : bool
    {
        if (false === $this->validated) {
            $this->validate();
        }
        return (count($this->validation_errors) > 0);
    }
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;
    }
1149164
public function validate()
    {
        $validatorFactory = new Factory(new Translator(new ArrayLoader(), 'en'), new Container());
        $validator = $validatorFactory->make($this->attributes, static::$rules);

        if ($validator->passes()) {
            return true;
        }

        $this->setErrors($validator->messages());

        return false;
    }
5477
public function valid() : bool
    {
        if ($this->privateErrors()) {
            return false;
        }
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            if (!$element->getElement()->valid()) {
                return false;
            }
        }
        return true;
    }