moduleDataSetup->getConnection()->startSetup(); $this->saveBlock( 'lts-home-announcement', 'LTS Home - Top Announcement', $this->announcementContent() ); $this->saveBlock( 'lts-home-dealer-pricing', 'LTS Home - Dealer Pricing', $this->dealerPricingContent() ); $this->saveBlock( 'lts-home-product-lines', 'LTS Home - Shop By Product Line', $this->productLinesContent() ); $this->saveBlock( 'lts-home-shop-by-category', 'LTS Home - Shop By Category', $this->shopByCategoryContent() ); $page = $this->pageFactory->create()->getCollection() ->addFieldToFilter('identifier', 'athlete2-home-greece') ->addStoreFilter(0, false) ->setPageSize(1) ->getFirstItem(); if ($page->getId()) { $page->setContent($this->homePageContent()); $page->setPageLayout('1column'); $page->setIsActive(true); $page->save(); } $this->moduleDataSetup->getConnection()->endSetup(); return $this; } private function saveBlock(string $identifier, string $title, string $content): void { $block = $this->blockFactory->create()->getCollection() ->addFieldToFilter('identifier', $identifier) ->setPageSize(1) ->getFirstItem(); if (!$block->getId()) { $block = $this->blockFactory->create(); } $block->setTitle($title) ->setIdentifier($identifier) ->setContent($content) ->setIsActive(true) ->setStores([0]) ->save(); } private function announcementContent(): string { return <<<'HTML'
Request a Quote Help
HTML; } private function dealerPricingContent(): string { return <<<'HTML'

Sign In For Dealer Pricing

Unlock Dealer Pricing, Availability, And Checkout.

HTML; } private function productLinesContent(): string { return <<<'HTML'

Shop By Product Line

Platinum Plus cameras and recorder Platinum Our flagship line delivering maximum performance, reliability, and innovation. Explore  ⟶ Pro-X cameras and recorder PRO-X Advanced solutions for professionals who demand more. Explore  ⟶ Defendas integrated access control system DEFENDAS Integrated security systems for access control and device management. Explore  ⟶
HTML; } private function homePageContent(): string { return <<<'HTML'
{{block class="Magento\Cms\Block\Block" block_id="lts-home-dealer-pricing"}} {{block class="Magento\Cms\Block\Block" block_id="lts-home-product-lines"}} {{block class="Magento\Cms\Block\Block" block_id="lts-home-shop-by-category"}} {{block class="Magento\Cms\Block\Block" block_id="lts-home-resources"}} Feedback
HTML; } private function shopByCategoryContent(): string { return <<<'HTML'

Shop By Category

IP Cameras NVR TVI Cameras DVR Access Control Cable HDD Accessories
HTML; } public static function getDependencies(): array { return []; } public function getAliases(): array { return []; } }