验证用户是否已存在
@param string $attribute
@param array $params
438398
public function validateNickname($attribute, $params)
    {
        if (!$this->hasErrors()) {
            if (!$this->_user) {
                $this->addError($attribute, Yii::t('message', 'You enter the user name does not exist oh！'));
            }
        }
    }
321123
protected function validateIn( $attribute, $value, $parameters )
	{
		if ( is_array( $value ) && $this->hasRule( $attribute, 'Array' ) )
		{
			return count( array_diff( $value, $parameters ) ) == 0;
		}

		return !is_array( $value ) && in_array( (string) $value, $parameters );
	}
1044559
public function validateSlugCreate( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			if( self::isExistBySlug( $this->slug ) ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_SLUG_EXIST ) );
			}
		}
	}
1301149
protected function processAttributeOptions(array $data, Attribute $attribute)
    {
        if (isset($data['type'])) {
            $this->processDataType($data['type'], $attribute);
        }

        if (isset($data['many'])) {
            $attribute->setMany($data['many']);
        }

        if (isset($data['processNull'])) {
            $attribute->setProcessNull($data['processNull']);
        }
    }
417443
public function behaviorValidator($attribute, $params)
    {
        $behavior = $params['behavior'];
        $validator = $params['validator'];
        unset($params['behavior']);
        unset($params['validator']);
        if (($behavior = $this->getBehavior($behavior)) !== null) {
            return $behavior->{$validator}($attribute, $params);
        }

        return true;
    }
553807
public function validateEmailChange( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			$properties		= CoreProperties::getInstance();
			$existingUser	= self::findById( $this->id );

			if( isset( $existingUser ) && $existingUser->email !== $this->email && !$properties->isChangeEmail() ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_CHANGE_EMAIL ) );
			}
		}
	}
1170028
public function validatePassword($attribute, $params)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            if ($user && $user->status == User::STATUS_BLOCKED) {
                $this->addError($attribute, Yii::t('maddoger/user', 'User is blocked.'));
                return;
            }
            if (!$user || !$user->validatePassword($this->password)) {
                $this->addError($attribute, 'Incorrect username or password.');
            }
        }
    }
487734
public function validateEmailUpdate( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			$existingUser = self::findByEmail( $this->email );

			if( isset( $existingUser ) && $this->id != $existingUser->id ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_EMAIL_EXIST ) );
			}
		}
	}
1217316
public function validateReservedWord($attribute,$params)
	{
		$value=$this->$attribute;
		if(in_array(strtolower($value),self::$keywords))
			$this->addError($attribute, $this->getAttributeLabel($attribute).' cannot take a reserved PHP keyword.');
	}
1349803
protected function validateAttribute($object, $attribute)
    {
        if (null === $this->callback || !is_callable($this->callback)) {
            throw new Exception('属性"callback"必须指定为一个可调用的回调', 101400401);
        }
        call_user_func_array($this->callback, [$object, $attribute]);
    }
124783
public static function deleteAllByAttributes($attributes, $condition = null, $params = array())
    {
        if (!is_a($condition, '\\mpf\\datasources\\sql\\ModelCondition')) {
            $condition = ModelCondition::getFrom($condition, get_called_class());
        }
        /* @var $condition ModelCondition */
        foreach ($attributes as $k => $v) {
            $condition->compareColumn($k, $v);
        }
        return static::deleteAll($condition, $params);
    }
690952
public function validatePassword($attribute, $params)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            if (!$user || !$user->validatePassword($this->password)) {
                $this->addError($attribute, Yii::t($this->tcModule, 'Incorrect username or password.'));
            }
        }
    }
312590
public function setAttribute($attribute)
    {
        if (strpos($attribute, '.') !== false) {
            $pieces = explode('.', $attribute, 2);
            $this->setAlias($pieces[0]);
            $attribute = $pieces[1];
        // If an alias was already set then this must be set back to null.
        } else {
            $this->alias = null;
        }
        $this->attribute = $attribute;
    }
1018265
protected function addAttributes(&$html, array $attributes)
	{
		if ( count($attributes) > 0 )
		{
			$attributes = Html::arrayToAttributes($attributes);

			$html .= ' ' . $attributes;
		}
	}
1179721
protected function doResolveParametersForAttribute($attribute, $parameters)
    {
        $this->attributes[$attribute] = $this->getValueForParameters(
            $parameters,
            $this->attributes[$attribute],
            $this->attributes
        );
    }
511780
public function authenticate($attribute,$params)
	{
		$this->_identity=new UserIdentity('yiier',$this->password);
		if(!$this->_identity->authenticate())
			$this->addError('password','Incorrect password.');
	}
177345
public function gmdate($attribute, $params, $validator)
    {
        if (isset($this->$attribute)) {
            $timestamp = strtotime($this->$attribute);
            $this->{$attribute . 'InUtc'} = gmdate('Y-m-d H:i:s', $timestamp);
        }
    }