Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Processor.php
Go to the documentation of this file.
1 <?php
7 
8 class Processor implements ProcessorInterface
9 {
13  protected $viewsFactory;
14 
18  public function __construct(View\CollectionFactory $viewsFactory)
19  {
20  $this->viewsFactory = $viewsFactory;
21  }
22 
29  protected function getViewsByGroup($group = '')
30  {
31  $collection = $this->viewsFactory->create();
32  return $group ? $collection->getItemsByColumnValue('group', $group) : $collection->getItems();
33  }
34 
41  public function update($group = '')
42  {
43  foreach ($this->getViewsByGroup($group) as $view) {
44  $view->update();
45  }
46  }
47 
54  public function clearChangelog($group = '')
55  {
56  foreach ($this->getViewsByGroup($group) as $view) {
57  $view->clearChangelog();
58  }
59  }
60 }
$group
Definition: sections.phtml:16
__construct(View\CollectionFactory $viewsFactory)
Definition: Processor.php:18