public function byIdentity($identity = null)
    {
        if (!$identity) {
            $identity = Yii::$app->user->identity;
        }
        if (method_exists($identity, 'canGetProperty') && !$identity->canGetProperty('guid')) {
            return $this;
        }
        return $this->createdBy($identity->getGUID());
    }
public function byIdentity($identity = null)
    {
        if (!$identity) {
            $identity = Yii::$app->user->identity;
        }
        if (method_exists($identity, 'canGetProperty') && !$identity->canGetProperty('guid')) {
            return $this;
        }
        return $this->createdBy($identity->getGUID());
    }
public function byIdentity ( $ identity = null ) { if ( ! $ identity ) { $ identity = Yii :: $ app -> user -> identity ; } if ( method_exists ( $ identity , 'canGetProperty' ) && ! $ identity -> canGetProperty ( 'guid' ) ) { return $ this ; } return $ this -> createdBy ( $ identity -> getGUID ( ) ) ; }
Attach current identity to createdBy condition.
@param BaseUserModel $identity
@return $this
Attach current identity to createdBy condition .