Exemple #1
0
 /**
  * Retrieve latest critical item
  *
  * @return bool|\Magento\Adminnotification\Model\Inbox
  */
 protected function _getLatestItem()
 {
     if ($this->_latestItem == null) {
         $items = array_values($this->_criticalCollection->getItems());
         if (count($items)) {
             $this->_latestItem = $items[0];
         } else {
             $this->_latestItem = false;
         }
     }
     return $this->_latestItem;
 }
Exemple #2
0
 /**
  * Init collection select
  *
  * @return \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->addFilter('is_remove', 0);
     $this->addFilter('is_read', 0);
     $this->setOrder('date_added');
     return $this;
 }
Exemple #3
0
 /**
  * Add remove filter
  *
  * @return \Magento\AdminNotification\Model\Resource\Grid\Collection|\Magento\Framework\Model\Resource\Db\Collection\AbstractCollection
  */
 protected function _initSelect()
 {
     parent::_initSelect();
     $this->addRemoveFilter();
     return $this;
 }
 /**
  * Retrieve the list of latest unread notifications
  *
  * @return \Magento\AdminNotification\Model\Resource\Inbox\Collection
  */
 public function getLatestUnreadNotifications()
 {
     return $this->_notificationList->setPageSize(self::NOTIFICATIONS_NUMBER);
 }