Check for a property of CFileValidator

@param CModel $model
@param string $attribute
@param string $property

@return string property's value or null
436981
private function getFileValidatorProperty($model = null, $attribute = null, $property = null)
	{
		if (!isset($model, $attribute, $property)) {
			return null;
		}

		foreach ($model->getValidators($attribute) as $validator) {
			if ($validator instanceof CFileValidator) {
				$ret = $validator->$property;
			}
		}
		return isset($ret) ? $ret : null;
	}
571862
public function check($model)
    {
        if ($this->isSubQuery()) {
            return Builder::make($model, $this->property)->check() && Builder::make($model, $this->propertyToCompare)->check();
        }

        switch ($this->operator) {
            case '=':
                return $this->attribute($model, $this->property) === $this->attribute($model, $this->propertyToCompare);
                break;
            case '>=':
                return $this->attribute($model, $this->property) >= $this->attribute($model, $this->propertyToCompare);
                break;
            case '<=':
                return $this->attribute($model, $this->property) <= $this->attribute($model, $this->propertyToCompare);
                break;
            case '<>':
                return $this->attribute($model, $this->property) !== $this->attribute($model, $this->propertyToCompare);
                break;
            case '>':
                return $this->attribute($model, $this->property) > $this->attribute($model, $this->propertyToCompare);
                break;
            case '<':
                return $this->attribute($model, $this->property) < $this->attribute($model, $this->propertyToCompare);
                break;
        }
        throw new BadMethodCallException('Operator not supported: '.$this->operator);
    }
255942
public static function getInstance(Model $model, $attribute)
    {
        foreach ($model->behaviors as $behavior) {
            if ($behavior instanceof self && $behavior->attribute == $attribute) {
                return $behavior;
            }
        }

        throw new InvalidCallException('Missing behavior for attribute ' . VarDumper::dumpAsString($attribute));
    }
1079454
protected function validateAttribute($object,$attribute)
	{
		if(!$this->setOnEmpty)
			$object->$attribute=$this->value;
		else
		{
			$value=$object->$attribute;
			if($value===null || $value==='')
				$object->$attribute=$this->value;
		}
	}
430854
protected function validateAttribute($object,$attribute)
	{
		$value=$object->$attribute;
		if($this->allowEmpty && $this->isEmpty($value))
			return;
		$captcha=$this->getCaptchaAction();
		// reason of array checking is explained here: https://github.com/yiisoft/yii/issues/1955
		if(is_array($value) || !$captcha->validate($value,$this->caseSensitive))
		{
			$message=$this->message!==null?$this->message:Yii::t('yii','The verification code is incorrect.');
			$this->addError($object,$attribute,$message);
		}
	}
729846
public function validateFilled($attribute, $value)
    {
        if (Arr::has($this->data, $attribute)) {
            return $this->validateRequired($attribute, $value);
        }

        return true;
    }
41450
public function validateModelId($attribute, $params)
    {
        /** @var ActiveRecord $class */
        $class = Model::findIdentity($this->model_class);
        if ($class === null) {
            $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
        } else {
            $model = $class->name;
            if ($model::find()->where(['id' => $this->entity_id]) === false) {
                $this->addError($attribute, \Yii::t('net_frenzel_communication', 'ERROR_MSG_INVALID_MODEL_ID'));
            }
        }
    }
714576
public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        $captcha = $this->createCaptchaAction($model);
        $valid = !is_array($value) && $captcha->validate($value);
        $isExpired = $captcha->isExpired();

        $result = $isExpired ? [$this->getMessageForExpiredCaptcha(), []] : ($valid ? null : [$this->message, []]);
//        $result = $this->validateValue($model->$attribute, $model);
        if (!empty($result)) {
            $this->addError($model, $attribute, $result[0], $result[1]);
        }
    }
94715
public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        if (!is_numeric($value) && !is_float($value)) {
            return $model->addError($attribute, Yii::t('luya', $this->message, ['attribute' => $model->getAttributeLabel($attribute)]));
        }
    }
134441
protected function validate($attribute, $rule)
	{
		list($rule, $parameters) = $this->parseRule($rule);

		if ($rule == '') return;

		// We will get the value for the given attribute from the array of data and then
		// verify that the attribute is indeed validatable. Unless the rule implies
		// that the attribute is required, rules are not run for missing values.
		$value = $this->getValue($attribute);

		$validatable = $this->isValidatable($rule, $attribute, $value);

		$method = "validate{$rule}";

		if ($validatable && ! $this->$method($attribute, $value, $parameters, $this))
		{
			$this->addFailure($attribute, $rule, $parameters);
		}
	}
1320445
protected function validateAttribute($object,$attribute)
	{
		$value=$object->$attribute;
		if($this->allowEmpty && $this->isEmpty($value))
			return;

		if(!$this->validateValue($value))
		{
			$message=$this->message!==null?$this->message:Yii::t('yii','{attribute} is not a valid email address.');
			$this->addError($object,$attribute,$message);
		}
	}
1052676
protected function getClientOptions($model, $attribute)
    {
        $label = $model->getAttributeLabel($attribute);

        $options = [];
        if ($this->message !== null) {
            $options['message'] = Yii::$app->getI18n()->format($this->message, [
                'attribute' => $label,
            ], Yii::$app->language);
        }

        $options['skipOnEmpty'] = $this->skipOnEmpty;

        if (!$this->skipOnEmpty) {
            $options['uploadRequired'] = Yii::$app->getI18n()->format($this->uploadRequired, [
                'attribute' => $label,
            ], Yii::$app->language);
        }

        if ($this->mimeTypes !== null) {
            $options['mimeTypes'] = $this->mimeTypes;
            $options['wrongMimeType'] = Yii::$app->getI18n()->format($this->wrongMimeType, [
                'attribute' => $label,
                'mimeTypes' => implode(', ', $this->mimeTypes),
            ], Yii::$app->language);
        }

        if ($this->extensions !== null) {
            $options['extensions'] = $this->extensions;
            $options['wrongExtension'] = Yii::$app->getI18n()->format($this->wrongExtension, [
                'attribute' => $label,
                'extensions' => implode(', ', $this->extensions),
            ], Yii::$app->language);
        }

        if ($this->minSize !== null) {
            $options['minSize'] = $this->minSize;
            $options['tooSmall'] = Yii::$app->getI18n()->format($this->tooSmall, [
                'attribute' => $label,
                'limit' => $this->minSize,
                'formattedLimit' => Yii::$app->formatter->asShortSize($this->minSize),
            ], Yii::$app->language);
        }

        if ($this->maxSize !== null) {
            $options['maxSize'] = $this->maxSize;
            $options['tooBig'] = Yii::$app->getI18n()->format($this->tooBig, [
                'attribute' => $label,
                'limit' => $this->getSizeLimit(),
                'formattedLimit' => Yii::$app->formatter->asShortSize($this->getSizeLimit()),
            ], Yii::$app->language);
        }

        if ($this->maxFiles !== null) {
            $options['maxFiles'] = $this->maxFiles;
            $options['tooMany'] = Yii::$app->getI18n()->format($this->tooMany, [
                'attribute' => $label,
                'limit' => $this->maxFiles,
            ], Yii::$app->language);
        }

        return $options;
    }
1365203
public function validateAttribute($model, $attribute)
    {
        $this->_model = $model;
        $this->_attributeName = $attribute;
        $result = $this->validateValue($model->$attribute);
        if (!empty($result)) {
            $this->addError($model, $attribute, $result[0], $result[1]);
        }
    }
12038
public function validateAttribute($model, $attribute)
    {
        $country = '';
        if ($this->country !== null) {
            $country = $this->country;
        } elseif ($this->countryAttribute !== null) {
            $country = $model->{$this->countryAttribute};
        } elseif ($this->countryCodeAttribute !== null) {
            $country = $model->{$this->countryCodeAttribute};
        }
        // if empty country and used strict mode
        if (empty($country) && $this->strict) {
            $this->addError($model, $attribute, Yii::t('app', $this->strictModeMessage));

            return false;
        }
        if (empty($country)) {
            return true;
        }
        $phoneUtil = PhoneNumberUtil::getInstance();
        try {
            $numberProto = $phoneUtil->parse($model->$attribute, $country);
            if ($phoneUtil->isValidNumber($numberProto)) {
                if ($this->format) {
                    $model->$attribute = $phoneUtil->format($numberProto, PhoneNumberFormat::INTERNATIONAL);
                }

                return true;
            } else {
                $this->addError($model, $attribute, Yii::t('app', $this->message));

                return false;
            }
        } catch (NumberParseException $e) {
            $this->addError($model, $attribute, Yii::t('app', $this->numberParseExceptionMessage));
        }
    }
646916
protected function isAttributeBoolean(ModelAttributeData $attribute)
    {
        if ($attribute->cast == AttributeCast::BOOLEAN) {
            return true;
        }

        return $attribute->type === 'tinyint' && $attribute->length === 1;
    }
552844
protected function validateAttribute (string $attribute=NULL) : bool
	{
		if (!property_exists($this, $attribute))
		{
			$this->error = "Attribute: ".ucfirst($attribute)." is not a class object.";
        	return FALSE;
		}
        $result = (is_array($this->$attribute)) ? !empty($this->$attribute) : Validate::hasValue($this->$attribute);
        if ($result) return TRUE;
		$this->error = "Set ".ucfirst($attribute)." to log your message.";
    	return FALSE;
	}
379421
public function validatePassword($attribute)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            
            if ($user && $this->userAttemptBruteForceLock($user)) {
                return $this->addError($attribute, Module::t('model_loginform_max_user_attempts', ['time' => Yii::$app->formatter->asRelativeTime($user->login_attempt_lock_expiration)]));
            }
            
            if (!$user || !$user->validatePassword($this->password)) {
                if ($this->attempts) {
                    // use `model_loginform_wrong_user_or_password` instead of `model_loginform_wrong_user_or_password_attempts` due to informations about correct email input.
                    $this->addError($attribute, Module::t('model_loginform_wrong_user_or_password', ['attempt' => $this->attempts, 'allowedAttempts' => $this->allowedAttempts]));
                } else {
                    $this->addError($attribute, Module::t('model_loginform_wrong_user_or_password'));
                }
            }
        }
    }