Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CatalogCheckIsUsingStaticUrlsAllowedObserver.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
17  protected $catalogData;
18 
22  public function __construct(\Magento\Catalog\Helper\Data $catalogData)
23  {
24  $this->catalogData = $catalogData;
25  }
26 
33  public function execute(\Magento\Framework\Event\Observer $observer)
34  {
35  $storeId = $observer->getEvent()->getData('store_id');
36  $result = $observer->getEvent()->getData('result');
37  $result->isAllowed = $this->catalogData->setStoreId($storeId)->isUsingStaticUrlsAllowed();
38  }
39 }