Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Catalog.php
Go to the documentation of this file.
1 <?php
13 
18 
19 abstract class Catalog extends Action
20 {
26  const ADMIN_RESOURCE = 'Magento_CatalogRule::promo_catalog';
27 
35 
41  protected $_coreRegistry = null;
42 
48  protected $_dateFilter;
49 
57  public function __construct(Context $context, Registry $coreRegistry, Date $dateFilter)
58  {
59  parent::__construct($context);
60  $this->_coreRegistry = $coreRegistry;
61  $this->_dateFilter = $dateFilter;
62  }
63 
69  protected function _initAction()
70  {
71  $this->_view->loadLayout();
72  $this->_setActiveMenu(
73  'Magento_CatalogRule::promo_catalog'
74  )->_addBreadcrumb(
75  __('Promotions'),
76  __('Promotions')
77  );
78  return $this;
79  }
80 
88  public function setDirtyRulesNoticeMessage($dirtyRulesNoticeMessage)
89  {
90  $this->_dirtyRulesNoticeMessage = $dirtyRulesNoticeMessage;
91  }
92 
98  public function getDirtyRulesNoticeMessage()
99  {
100  $defaultMessage = __(
101  'We found updated rules that are not applied. Please click "Apply Rules" to update your catalog.'
102  );
103  return $this->_dirtyRulesNoticeMessage ? $this->_dirtyRulesNoticeMessage : $defaultMessage;
104  }
105 }
__()
Definition: __.php:13
__construct(Context $context, Registry $coreRegistry, Date $dateFilter)
Definition: Catalog.php:57
setDirtyRulesNoticeMessage($dirtyRulesNoticeMessage)
Definition: Catalog.php:88