/* Decoded by unphp.net */ listen('shop.hook.' . \HOOK_SEITE_PAGE, function () { if (Shop::getPageType() !== \PAGE_STARTSEITE) { return; } Shop::Smarty()->assign('startManufacturers', $this->getAttributedCategories()) ->assign('jtl_fpc_title', $this->getPlugin()->getLocalization()->getTranslation('jtl_startcats_title')); }); $dispatcher->listen('shop.hook.' . \HOOK_SMARTY_INC, function (array $args) { $smarty = $args['smarty']; /** @var JTLSmarty $smarty */ $smarty->assign('boxName_1', $this->getPlugin()->getConfig()->getValue('jtl_startcats_position_1')); $smarty->assign('boxName_2', $this->getPlugin()->getConfig()->getValue('jtl_startcats_position_2')); }); } /** * @return Hersteller[] */ private function getAttributedCategories(): array { $cacheID = 'jtl_startcats_category_list_' . Shop::getLanguageID(); $manufacturerIDs = $this->getCache()->get($cacheID); if ($manufacturerIDs === false) { $manufacturerIDs = $this->getDB()->query( "SELECT kHersteller FROM thersteller ORDER BY cName", ReturnType::COLLECTION )->slice(0, 4)->map(function (stdClass $e) { return (int)$e->kHersteller; }); /** @var Collection $manufacturerIDs */ $tags = $manufacturerIDs->map(static function (int $id) { return \CACHING_GROUP_MANUFACTURER . '_' . $id; }); $tags[] = \CACHING_GROUP_MANUFACTURER; $this->getCache()->set($cacheID, $manufacturerIDs, $tags); } return $manufacturerIDs->map(function (int $id) { return new Hersteller($id); })->all(); } } ?>