public function __get($name) { try { return parent::__get($name); } catch (\Exception $e) { $val = \Yii::$app->session->get("user.{$name}", false); if (!$val) { throw $e; } return $val; } }