blockFactory = $blockFactory; $this->blockResource = $blockResource; } /** * @inheritdoc */ public function execute(string $identifier, int $storeId) : BlockInterface { $block = $this->blockFactory->create(); $block->setStoreId($storeId); $this->blockResource->load($block, $identifier, BlockInterface::IDENTIFIER); if (!$block->getId()) { throw new NoSuchEntityException(__('The CMS block with the "%1" ID doesn\'t exist.', $identifier)); } return $block; } }