/** @var ModifierTemplate2SizeResolver $sizeResolver */ $sizeResolver = $this->di->get( class: 'modifierTemplate2SizeResolver', config: [ 'modifierTemplateId' => $option['modifier_template_id'], 'modifierTemplateName' => $option['name'], ] ); $dataGroupId = $sizeResolver->sizeType->asGroupLabel( $sizeResolver->groupLabelReplacements ) ?? 'Другое'; // в спец. группу если популярный if ( $option['is_popular'] && !isset($popularOptions[$option['modifier_template_id']]) ) {
->where([ 'IN', 'category_id', $this->filterBounder->categoryIds, ]) ->all(); $this->transformRawOptions(); } /** * TODO[emptyPhpDoc] * @return void */
/** * {@inheritDoc} */ public function load(): void { $this->_options = []; $this->buildAndExecuteQueries(); } /** * TODO[emptyPhpDoc] * @return void */
* {@inheritDoc} */ public function init(): void { parent::init(); if ($this->isLazyLoad === false) { $this->load(); } } }
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
$config = $this->resolveDependencies($config); if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) { // set $config as the last parameter (existing one will be overwritten) $dependencies[count($dependencies) - 1] = $config; return $reflection->newInstanceArgs($dependencies); } $object = $reflection->newInstanceArgs($dependencies); foreach ($config as $name => $value) { $object->$name = $value; }
$class = $class->id; } if (isset($this->_singletons[$class])) { // singleton return $this->_singletons[$class]; } elseif (!isset($this->_definitions[$class])) { return $this->build($class, $params, $config); } $definition = $this->_definitions[$class]; if (is_callable($definition, true)) { $params = $this->resolveDependencies($this->mergeParams($class, $params));
$config = array_merge($definition, $config); $params = $this->mergeParams($class, $params); if ($concrete === $class) { $object = $this->build($class, $params, $config); } else { $object = $this->get($concrete, $params, $config); } } elseif (is_object($definition)) { return $this->_singletons[$class] = $definition; } else { throw new InvalidConfigException('Unexpected object definition type: ' . gettype($definition)); }
* {@inheritDoc} */ public function initDataAfterTechnicalFilteringAndRegionalDistribution(): void { if ($this->technicalFilterBounder->isActive === true) { /** @var FilterableSpecialBlockModifierTemplateAvailableFilterOptionByFilterBounderDao $aggregator */ $aggregator = $this->di->get( class: 'filterableSpecialBlockModifierTemplateAvailableFilterOptionByFilterBounderDao', config: [ 'storage' => $this->storage, 'filterBounder' => $this->technicalFilterBounder, 'filterableSpecialBlock' =>
/** * {@inheritDoc} */ public function initData(): void { $this->initDataAfterTechnicalFilteringAndRegionalDistribution(); $this->initCurrentValues(); } /** * {@inheritDoc} */
$this->changeFilterConfig( $filter, $changedFilterConfig['config'] ); } $filter->initData(); if ( $this->currentFilterableBlockId !== null && $this->currentFilterableBlockId == $filter->filterableBlock->filterable_block_id ) {
], ] ]; // устанавливаются значения из queryParam // инициализируются начальные опции блоков фильтрации $this->filterForm->initComponent($technicalChangedFilterConfigs); } } // если после тех. фильтрации и региональной дистрибьюции // есть набор product_id - то он, как первое ограничение // идет в клиентскую фильтрацию
/** * TODO[emptyPhpDoc] * @return void */ public function applyFullFilter(): void { $status = $this->prepareAllManual(); $this->isEmptyResult = !$status; return; } /** * TODO[emptyPhpDoc]
] ) ] ); } // and apply all filters $this->appFilterDao->applyFullFilter(); } private function initWidgetData(): void { // TODO[] сделать в учет в одном месте // (создание и конфига всего рендеринга)
$this->initWidgetData(); } private function initOther(): void { $this->initWidgetData(); $this->initCatalogData(); } private function fillRenderDataCategoryLinker(): void { /** @var WidgetCollector2WidgetPlaceRendererV1ConfigGenerator $configGenerator */ $configGenerator = $this->di->get(
case SectionTypeEnum::categoryIndex: case SectionTypeEnum::categoryBrand: case SectionTypeEnum::categoryProductLine: case SectionTypeEnum::stock: case SectionTypeEnum::commonTag: case SectionTypeEnum::categoryTag: $this->initOther(); break; } $this->setSeoDepends(); $this->prepareSeo();
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
$config = $this->resolveDependencies($config); if (!empty($dependencies) && $reflection->implementsInterface('yii\base\Configurable')) { // set $config as the last parameter (existing one will be overwritten) $dependencies[count($dependencies) - 1] = $config; return $reflection->newInstanceArgs($dependencies); } $object = $reflection->newInstanceArgs($dependencies); foreach ($config as $name => $value) { $object->$name = $value; }
$class = $class->id; } if (isset($this->_singletons[$class])) { // singleton return $this->_singletons[$class]; } elseif (!isset($this->_definitions[$class])) { return $this->build($class, $params, $config); } $definition = $this->_definitions[$class]; if (is_callable($definition, true)) { $params = $this->resolveDependencies($this->mergeParams($class, $params));
$config = array_merge($definition, $config); $params = $this->mergeParams($class, $params); if ($concrete === $class) { $object = $this->build($class, $params, $config); } else { $object = $this->get($concrete, $params, $config); } } elseif (is_object($definition)) { return $this->_singletons[$class] = $definition; } else { throw new InvalidConfigException('Unexpected object definition type: ' . gettype($definition)); }
/** * @return mixed */ public function actionIndex(string $slug) { /** @var SectionViewActivePage $this->activePage */ $this->activePage = Yii::$container->get( class: 'sectionViewActivePage', config: [ 'model' => $this->findSection($slug), 'activeRegion' => Yii::$container->get('activeRegion'), 'request' => Yii::$app->request, ]
$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 = [ 'slug' => 'accessories/sleeptek/roll', ]; $_SESSION = [ '__flash' => [], ];