Skip to content

Commit dbe65c4

Browse files
authored
Update PageToExclude.php
1 parent 8035acb commit dbe65c4

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Setup/Patch/Data/PageToExclude.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,19 @@ public function __construct(
4040
}
4141

4242
/**
43-
* @return void
43+
* {@inheritdoc}
4444
*/
4545
public function apply()
4646
{
4747
$this->moduleDataSetup->getConnection()->startSetup();
4848

4949
$pageCollection = $this->pageCollectionFactory->create();
50-
51-
$pageCollection->addFieldToFilter('identifier', ['in' => ['no-route', 'home', 'enable-cookies']]);
52-
53-
foreach ($pageCollection as $page) {
54-
$page->setMfExcludeHtmlSitemap(1);
55-
}
56-
57-
$pageCollection->save();
50+
$connection = $pageCollection->getConnection();
51+
$connection->update(
52+
$pageCollection->getTable('cms_page'),
53+
['mf_exclude_html_sitemap' => 1],
54+
['identifier IN (?)' => ['no-route', 'home', 'enable-cookies']]
55+
);
5856

5957
$this->moduleDataSetup->getConnection()->endSetup();
6058
}

0 commit comments

Comments
 (0)