mainAdminUserModel->getAdminInfoById($adminId); if (!$userInfo) { return false; } Context::set($key, $userInfo); return $userInfo; } /** * @param int $adminId * @return int */ protected function getCityById(int $adminId): int { $userInfo = $this->getUserInfo($adminId); if (!$userInfo) { return 0; } $key = 'section_city:' . $userInfo->section_id; if (Context::has($key)) { return Context::get($key, 0); } $cityId = $this->mainAdminSectionModel->getCityById($userInfo->section_id); if (!$cityId) { return 0; } Context::set($key, $cityId); return $cityId; } }