vendor/shopware/storefront/Page/Navigation/NavigationPageLoadedHook.php line 16

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Storefront\Page\Navigation;
  3. use Shopware\Core\Framework\Script\Execution\Awareness\SalesChannelContextAwareTrait;
  4. use Shopware\Core\System\SalesChannel\SalesChannelContext;
  5. use Shopware\Storefront\Page\PageLoadedHook;
  6. /**
  7.  * Triggered when the NavigationPage is loaded
  8.  *
  9.  * @hook-use-case data_loading
  10.  *
  11.  * @since 6.4.8.0
  12.  */
  13. class NavigationPageLoadedHook extends PageLoadedHook
  14. {
  15.     use SalesChannelContextAwareTrait;
  16.     public const HOOK_NAME 'navigation-page-loaded';
  17.     private NavigationPage $page;
  18.     public function __construct(NavigationPage $pageSalesChannelContext $context)
  19.     {
  20.         parent::__construct($context->getContext());
  21.         $this->salesChannelContext $context;
  22.         $this->page $page;
  23.     }
  24.     public function getName(): string
  25.     {
  26.         return self::HOOK_NAME;
  27.     }
  28.     public function getPage(): NavigationPage
  29.     {
  30.         return $this->page;
  31.     }
  32. }