Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddDirtyRulesNotice.php
Go to the documentation of this file.
1 <?php
7 
10 
15 {
19  private $messageManager;
20 
26  public function __construct(\Magento\Framework\Message\ManagerInterface $messageManager)
27  {
28  $this->messageManager = $messageManager;
29  }
30 
35  public function execute(\Magento\Framework\Event\Observer $observer)
36  {
37  $dirtyRules = $observer->getData('dirty_rules');
38  if (!empty($dirtyRules)) {
39  if ($dirtyRules->getState()) {
40  $this->messageManager->addNoticeMessage($observer->getData('message'));
41  }
42  }
43  }
44 }
execute(\Magento\Framework\Event\Observer $observer)
__construct(\Magento\Framework\Message\ManagerInterface $messageManager)