|
| __construct (\Magento\AdminNotification\Model\InboxFactory $notificationFactory) |
|
| markAsRead ($notificationId) |
|
◆ __construct()
__construct |
( |
\Magento\AdminNotification\Model\InboxFactory |
$notificationFactory | ) |
|
- Parameters
-
\Magento\AdminNotification\Model\InboxFactory | $notificationFactory | |
Definition at line 25 of file NotificationService.php.
27 $this->_notificationFactory = $notificationFactory;
◆ markAsRead()
markAsRead |
( |
|
$notificationId | ) |
|
Mark notification as read
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 37 of file NotificationService.php.
39 $notification = $this->_notificationFactory->create();
40 $notification->load($notificationId);
41 if (!$notification->getId()) {
42 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Wrong notification ID specified.'));
44 $notification->setIsRead(1);
45 $notification->save();
◆ $_notificationFactory
The documentation for this class was generated from the following file: