/** * Получение пользователя по почте * @return array|bool|null|\yii\db\ActiveRecord */ protected function getUser() { if ($this->_user === false) { $this->_user = User::find()->where(['email' => $this->email])->one(); } return $this->_user; }