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