%PDF- %PDF-_modelStoreManagerInterface = $context->getStoreManager(); $this->_frameworkRegistry = $frameworkRegistry; parent::__construct( $context, $helperData, $modelConfig, $productUrl, $data, $context->getFilesystem(), $context->getUrlBuilder(), $context->getScopeConfig() ); } public function getRegistry() { return $this->_frameworkRegistry; } /** * Brand name of the current product * * @var string */ protected $_currentBrand; /** * Resource initialization */ protected function _construct() { parent::_construct(); $this->addData([ 'cache_lifetime' => 31536000, 'cache_tags' => [Block::CACHE_TAG], ]); } /** * Get cache key informative items * * @return array */ public function getCacheKeyInfo() { return [ 'BRANDS_LOGO', $this->_modelStoreManagerInterface->getStore()->getId(), $this->getTemplateFile(), 'template' => $this->getTemplate(), (int)$this->_modelStoreManagerInterface->getStore()->isCurrentlySecure(), $this->getCurrentBrand(), ]; } /** * Get current product's brand * * @return string */ public function getCurrentBrand() { if (NULL === $this->_currentBrand) { $this->_currentBrand = $this->getBrand($this->_frameworkRegistry->registry('current_product')); } return $this->_currentBrand; } /** * Deprecated * Returns current product * * @return \Magento\Catalog\Model\Product */ public function getCurrentProductObject() { return $this->_frameworkRegistry->registry('current_product'); } }