'certificates', 'category', 'photos', 'brand' ]) ->with('article') ->andWhere([Product::tableName() . '.id' => $id]); if (!$product = $this->cache->getOrSetQueryOne($query, ['product_with_full_information', $id])) { throw new \DomainException('Not found output ready product with all information by id ' . $id); } return $product; } /** * Получение единственно сущности продуктов по id * @param $id * @return null|Product
if ($dbCityId = Yii::$app->location->getDBCityId()) { $pharmacies = $this->filials->getAllForCity($dbCityId); } else { $pharmacies = []; } if (!$product = $this->products->getOneWithAllInformationById($id)) { throw new NotFoundHttpException('The requested page does not exist.'); } $reviewSearchModel = new ProductReviewSearchForm(); $reviewDataProvider = $this->reviews->getProductReviewElements($product->id, $reviewSearchModel);
$args = $this->controller->bindActionParams($this, $params); Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::debug("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require __DIR__ . '/../../common/config/main.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); (new yii\web\Application($config))->run();
$_GET = [ 'id' => 55, ]; $_SESSION = [ '__flash' => [], 'location_userLocation' => 'O:26:"shop\\location\\UserLocation":12:{s:11:"countryName";s:12:"Россия";s:10:"countryIso";s:2:"RU";s:8:"cityName";s:12:"Москва";s:8:"citySlug";s:6:"moskva";s:19:"isCityGlobalDefault";b:1;s:36:"' . "\0" . 'shop\\location\\UserLocation' . "\0" . 'cityInDb";b:1;s:9:"countryId";i:1;s:39:"' . "\0" . 'shop\\location\\UserLocation' . "\0" . 'countryInDb";b:1;s:15:"countryIsActive";b:1;s:35:"' . "\0" . 'shop\\location\\UserLocation' . "\0" . 'storage";O:44:"shop\\location\\storage\\SessionLocationStorage":0:{}s:37:"' . "\0" . 'shop\\location\\UserLocation' . "\0" . 'countries";O:40:"shop\\repositories\\i18n\\CountryRepository":0:{}s:34:"' . "\0" . 'shop\\location\\UserLocation' . "\0" . 'cities";O:37:"shop\\repositories\\i18n\\CityRepository":1:{s:44:"' . "\0" . 'shop\\repositories\\i18n\\CityRepository' . "\0" . 'cache";O:58:"shop\\managers\\cache\\containers\\i18n\\i18nApcuCacheContainer":2:{s:56:"' . "\0" . 'shop\\managers\\cache\\containers\\BaseCacheContainer' . "\0" . 'cache";O:20:"yii\\caching\\ApcCache":8:{s:7:"useApcu";b:1;s:9:"keyPrefix";s:4:"apcu";s:10:"serializer";N;s:15:"defaultDuration";i:0;s:37:"' . "\0" . 'yii\\caching\\Cache' . "\0" . '_igbinaryAvailable";b:0;s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:0:{}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";N;}s:12:"dataProvider";O:63:"shop\\managers\\cache\\containers\\DataProviderCacheContainerWorker":1:{s:79:"' . "\0" . 'shop\\managers\\cache\\containers\\DataProviderCacheContainerWorker' . "\0" . 'cacheContainer";r:14;}}}}', ];