Skip to content

Commit

Permalink
Update PageToExclude.php
Browse files Browse the repository at this point in the history
  • Loading branch information
magefan authored May 23, 2024
1 parent 8035acb commit dbe65c4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Setup/Patch/Data/PageToExclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@ public function __construct(
}

/**
* @return void
* {@inheritdoc}
*/
public function apply()
{
$this->moduleDataSetup->getConnection()->startSetup();

$pageCollection = $this->pageCollectionFactory->create();

$pageCollection->addFieldToFilter('identifier', ['in' => ['no-route', 'home', 'enable-cookies']]);

foreach ($pageCollection as $page) {
$page->setMfExcludeHtmlSitemap(1);
}

$pageCollection->save();
$connection = $pageCollection->getConnection();
$connection->update(
$pageCollection->getTable('cms_page'),
['mf_exclude_html_sitemap' => 1],
['identifier IN (?)' => ['no-route', 'home', 'enable-cookies']]
);

$this->moduleDataSetup->getConnection()->endSetup();
}
Expand Down

0 comments on commit dbe65c4

Please sign in to comment.