예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function getStoreId()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getStoreId');
     if (!$pluginInfo) {
         return parent::getStoreId();
     } else {
         return $this->___callPlugins('getStoreId', func_get_args(), $pluginInfo);
     }
 }
예제 #2
0
 /**
  * @param \Magento\Catalog\Model\ResourceModel\Config $config
  * @param callable $proceed
  * @return array
  */
 public function aroundGetAttributesUsedForSortBy(\Magento\Catalog\Model\ResourceModel\Config $config, \Closure $proceed)
 {
     $cacheId = self::PRODUCT_LISTING_SORT_BY_ATTRIBUTES_CACHE_ID . $config->getEntityTypeId() . '_' . $config->getStoreId();
     if ($this->isCacheEnabled && ($attributes = $this->cache->load($cacheId))) {
         return unserialize($attributes);
     }
     $attributes = $proceed();
     if ($this->isCacheEnabled) {
         $this->cache->save(serialize($attributes), $cacheId, [\Magento\Eav\Model\Cache\Type::CACHE_TAG, \Magento\Eav\Model\Entity\Attribute::CACHE_TAG]);
     }
     return $attributes;
 }