7 declare(strict_types=1);
55 \
Magento\Cms\Model\Template\FilterProvider $filterProvider,
56 \
Magento\Cms\Model\BlockFactory $blockFactory,
59 parent::__construct($context,
$data);
60 $this->_filterProvider = $filterProvider;
61 $this->_blockFactory = $blockFactory;
73 parent::_beforeToHtml();
74 $blockId = $this->
getData(
'block_id');
75 $blockHash = get_class($this) . $blockId;
77 if (isset(self::$_widgetUsageMap[$blockHash])) {
80 self::$_widgetUsageMap[$blockHash] =
true;
82 $block = $this->getBlock();
84 if ($block && $block->isActive()) {
86 $storeId = $this->_storeManager->getStore()->getId();
88 $this->_filterProvider->getBlockFilter()->setStoreId(
$storeId)->filter($block->getContent())
93 unset(self::$_widgetUsageMap[$blockHash]);
104 $block = $this->getBlock();
107 return $block->getIdentities();
118 private function getBlock(): ?
CmsBlock 124 $blockId = $this->
getData(
'block_id');
128 $storeId = $this->_storeManager->getStore()->getId();
130 $block = $this->_blockFactory->create();
131 $block->setStoreId(
$storeId)->load($blockId);
132 $this->block = $block;
135 }
catch (NoSuchEntityException $e) {
getData($key='', $index=null)