Ejemplo n.º 1
0
 private function findIdentity($username)
 {
     switch ($this->judgeUsernameType($username)) {
         case static::ACCOUNT_TYPE_STRING:
             return User::findIdentity($username);
         case static::ACCOUNT_TYPE_EMAIL:
             return User::findIdentityByEmail($username);
         default:
             throw new \yii\base\NotSupportedException('Not recognized account type.');
     }
 }