Returns true if data model passes validation.

Method wraps laravel validator's method passes()

@return bool
@throws \Exception
436606
public function passes()
    {
        if (!($this->validator instanceof \Illuminate\Validation\Validator)) {
            throw new LogicException('No model was set. Nothing to validate.');
        }

        return $this->getValidator()->passes();
    }
638217
protected function _validate()
	{

		// Check if validation is necessary and parsed
		if (static::$validates === false) return true;
		if (is_null(static::$_validation)) {
			require_once("Validation/Validation.php");
			static::$_validation = Validation\Validation::onModel(get_called_class());
		}

		
		// Go validate!
		$result = static::$_validation->validate($this);

		// Success?
		if ($result->success == false) {

			// Store errors
			$this->_errors = $result->errors;

			return false;
		} else {

			// Clear errors
			$this->_errors = null;

		}

		// True
		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;
    }
1252964
public function passes()
    {
        $this->messages = new MessageBag();

        // We'll spin through each rule, validating the attributes attached to that
        // rule. Any error messages will be added to the containers with each of
        // the other error messages, returning true if we don't have messages.
        foreach ($this->rules as $attribute => $rules) {
            foreach ($rules as $rule) {
                $this->validate($attribute, $rule);
            }
        }

        // Here we will spin through all of the "after" hooks on this validator and
        // fire them off. This gives the callbacks a chance to perform all kinds
        // of other validation that needs to get wrapped up in this operation.
        foreach ($this->after as $after) {
            call_user_func($after);
        }

        return count($this->messages->all()) === 0;
    }
984950
public function doValidation(): bool{
        $res = $this->validate();
        if ($res) {
            $this->status = self::ERROR;
        }
        return $res;
    }
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;
    }
429607
protected function validateData()
    {
        foreach ($this->relationalData as $attribute => &$data) {
            /** @var ActiveRecord $model */
            /** @var ActiveQuery $activeQuery */
            $activeQuery = $data['activeQuery'];
            foreach ($data['newModels'] as &$model) {
                if (!$model->validate()) {
                    $_errors = $model->getErrors();
                    $errors = [];

                    foreach ($_errors as $relatedAttribute => $error) {
                        if (!$activeQuery->multiple || !isset($activeQuery->link[$relatedAttribute])) {
                            $errors[$relatedAttribute] = $error;
                        }
                    }

                    if (count($errors)) {
                        $this->owner->addError($attribute, $errors);

                        return false;
                    }
                }
            }
        }

        return true;
    }
494507
public function isValid()
    {
        foreach ($this->objects as $fileInfo) {
            // Before validation callback
            $this->applyCallback('beforeValidation', $fileInfo);

            // Check is uploaded file
            if ($fileInfo->isUploadedFile() === false) {
                $this->errors[] = sprintf(
                    '%s: %s',
                    $fileInfo->getNameWithExtension(),
                    'Is not an uploaded file'
                );
                continue;
            }

            // Apply user validations
            foreach ($this->validations as $validation) {
                try {
                    $validation->validate($fileInfo);
                } catch (\Upload\Exception $e) {
                    $this->errors[] = sprintf(
                        '%s: %s',
                        $fileInfo->getNameWithExtension(),
                        $e->getMessage()
                    );
                }
            }

            // After validation callback
            $this->applyCallback('afterValidation', $fileInfo);
        }

        return empty($this->errors);
    }
300666
public function valid() {
        $echoStr = app('request')->get('echostr');
        if (!is_null($echoStr)) {
            if ($this->checkSignature()) {
                exit($echoStr);
            }
            throw new \Exception('no access');
        }
        $encryptStr = '';
        if (app('request')->isPost()) {
            $data = (array)Xml::decode($this->xml, false);
            if ($this->encryptType != 'aes') {
                return $data;
            }
            $encryptStr = $data['Encrypt'];
        }
        if (!$this->checkSignature($encryptStr)) {
            throw new \Exception('no access');
        }
        return true;
    }
1239984
public function validateReceived()
    {
        $this->debugMessage[] = 'IPN VALIDATION: START';
        if (!$this->ipnPostDataCheck()) {
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }

        //'ORDERSTATUS'
        $this->logFunc("IPN", $this->postData, @$this->postData['REFNOEXT']);
        if (!in_array(trim($this->postData['ORDERSTATUS']), $this->successfulStatus)) {
            $this->errorMessage[] = 'INVALID IPN ORDER STATUS: ' . $this->postData['ORDERSTATUS'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }
        $validationResult = false;
        $calculatedHashString = $this->createHashString($this->flatArray($this->postData, array("HASH")));
        if ($calculatedHashString == $this->postData['HASH']) {
            $validationResult = true;
        }
        if ($validationResult) {
            $this->debugMessage[] = 'IPN VALIDATION: ' . 'SUCCESSFUL';
            $this->debugMessage[] = 'IPN CALCULATED HASH: ' . $calculatedHashString;
            $this->debugMessage[] = 'IPN HASH: ' . $this->postData['HASH'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return true;
        } elseif (!$validationResult) {
            $this->errorMessage[] = 'IPN VALIDATION: ' . 'FAILED';
            $this->errorMessage[] = 'IPN CALCULATED HASH: ' . $calculatedHashString;
            $this->errorMessage[] = 'IPN RECEIVED HASH: ' . $this->postData['HASH'];
            $this->debugMessage[] = 'IPN VALIDATION: END';
            return false;
        }
        return false;
    }
369459
public function validate()
    {
        foreach ($this->inputValidations as $name => $data) {
            $validator = $data['callback'];
            $result = $validator($this);
            if ($result === false) {
                $this->logDebug("Validation FAILED: $name");
                $onError = $data['soundOnError'];
                if (is_array($onError)) {
                    foreach ($onError as $msg) {
                        $this->addPrePromptMessage($msg);
                    }
                } elseif (is_string($onError)) {
                    $this->addPrePromptMessage($onError);
                } else {
                    $this->logDebug("Ignoring validation sound: " . print_r($onError, true));
                }
                return false;
            }
            $this->logDebug("Validation OK: $name");
        }
        return true;
    }
1004356
public function valid()
    {
        if (! $this->messages) {
            $this->passes();
        }

        return array_diff_key(
            $this->data, $this->attributesThatHaveMessages()
        );
    }
1055734
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if the field contains a valid number value.
        if (!preg_match('/^-?\d+$/', $value)) {
            return false;
        }

        // check if the value is not to low.
        if ($this->min !== null) {
            if ($value < $this->min) {
                return false;
            }
        }

        // check if the value is not to high.
        if ($this->max !== null) {
            if ($value > $this->max) {
                return false;
            }
        }

        return true;
    }
1108637
public function hasDataValidation()
	{
		if (!isset($this->_parent)) {
			throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
		}

		return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
	}
886552
public function isValid() 
    {
        $this->_resetErrors();
        $cls = get_called_class();
        $rtn = true;
        $pk  = self::get(self::getPK());

        if (!array_key_exists($cls, self::$_validations)
            || sizeof(self::$_validations[$cls]) < 1
        ) {
            return true;
        }

        foreach (self::$_validations[$cls] as $attr => $validations) {
            $value = $this->_data[$attr];

            foreach ($validations as $validation) {
                $validation_key   = array_keys($validation);
                $validation_key   = $validation_key[0];
                $validation_value = array_values($validation);
                $validation_value = $validation_value[0];

                $args = array(get_called_class(), $pk, $attr, $value, $validation_value, $validation);
                $test = call_user_func_array(array("TORM\Validation", $validation_key), $args);

                if (!$test) {
                    $rtn = false;
                    $this->_addError($attr, Validation::$validation_map[$validation_key]);
                }
            }
        }
        return $rtn;
    }
14856
public function passes()
    {
        $this->message = null;
        foreach ($this->rules as $attribute => $rules) {
            foreach ($rules as $rule) {
                if (!$this->validate($attribute, $rule)) {
                    return false;
                }
            }
        }

        return true;
    }
159607
public function validateForm()
    {
        // Validates the model
        if ($this->validate())
        {
            // Getters and setters don't work in CFormModel? So set them manually
            $this->encryptionKey        = $this->getEncryptionKey();
            $this->encryptedPassword    = $this->getEncryptedPassword();
            return true;
        }
        
        return false;
    }