user->isGuest) { $this->getUserManager()->updateUserLastConnection(Yii::$app->user->identity); } return parent::beforeAction($event); } public function getLogic(): BusinessLogic { return Yii::$app->logic; } public function getUrlManagerProducer() { return Yii::$app->urlManagerProducer; } public function getUrlManagerFrontend() { return Yii::$app->urlManagerFrontend; } public function getUrlManagerBackend() { return Yii::$app->urlManagerBackend; } public function getUserCurrent(): ?User { return Yii::$app->user->identity; } public function isUserCurrentAdmin() { return $this->getUserManager()->isAdmin($this->getUserCurrent()); } public function getRequest() { return Yii::$app->request; } public function setFlash($key, $value = true, $removeAfterAccess = true): void { Yii::$app->session->setFlash($key, $value, $removeAfterAccess); } public function addFlash($key, $value = true, $removeAfterAccess = true): void { Yii::$app->session->addFlash($key, $value, $removeAfterAccess); } public function redirectReferer(): Response { return $this->redirect(Yii::$app->request->referrer ?: Yii::$app->homeUrl); } } ?>