Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Critical.php
Go to the documentation of this file.
1 <?php
9 
15 {
21  protected function _construct()
22  {
23  $this->_init(
24  \Magento\AdminNotification\Model\Inbox::class,
25  \Magento\AdminNotification\Model\ResourceModel\Inbox::class
26  );
27  }
28 
32  protected function _initSelect()
33  {
34  parent::_initSelect();
35  $this->addOrder(
36  'notification_id',
37  self::SORT_ORDER_DESC
38  )->addFieldToFilter(
39  'is_read',
40  ['neq' => 1]
41  )->addFieldToFilter(
42  'is_remove',
43  ['neq' => 1]
44  )->addFieldToFilter(
45  'severity',
46  \Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL
47  )->setPageSize(
48  1
49  );
50  return $this;
51  }
52 }
addOrder($field, $direction=self::SORT_ORDER_DESC)
Definition: AbstractDb.php:286