Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-admin-notification
Controller
Adminhtml
Notification
Remove.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\AdminNotification\Controller\Adminhtml\Notification
;
8
9
class
Remove
extends
\Magento\AdminNotification\Controller\Adminhtml\Notification
10
{
11
17
const
ADMIN_RESOURCE
=
'Magento_AdminNotification::adminnotification_remove'
;
18
22
public
function
execute
()
23
{
24
if
(
$id
= $this->
getRequest
()->getParam(
'id'
)) {
25
$model
= $this->_objectManager->create(\
Magento
\AdminNotification\Model\Inbox::class)->load(
$id
);
26
27
if
(!
$model
->getId()) {
28
$this->
_redirect
(
'adminhtml/*/'
);
29
return
;
30
}
31
32
try
{
33
$model
->setIsRemove(1)->save();
34
$this->messageManager->addSuccessMessage(
__
(
'The message has been removed.'
));
35
}
catch
(\
Magento
\Framework\Exception\LocalizedException $e) {
36
$this->messageManager->addErrorMessage($e->getMessage());
37
}
catch
(\Exception $e) {
38
$this->messageManager->addExceptionMessage(
39
$e,
40
__
(
"We couldn't remove the messages because of an error."
)
41
);
42
}
43
44
$this->
_redirect
(
'adminhtml/*/'
);
45
return
;
46
}
47
$this->
_redirect
(
'adminhtml/*/'
);
48
}
49
}
Magento\Backend\App\AbstractAction\_redirect
_redirect($path, $arguments=[])
Definition:
AbstractAction.php:316
Magento\AdminNotification\Controller\Adminhtml\Notification\Remove\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
Remove.php:17
$id
$id
Definition:
fieldset.phtml:14
$model
$model
Definition:
enable_catalog_product_reindex_schedule.php:9
Magento\AdminNotification\Controller\Adminhtml\Notification\Remove\execute
execute()
Definition:
Remove.php:22
__
__()
Definition:
__.php:13
Magento\AdminNotification\Controller\Adminhtml\Notification\Remove
Definition:
Remove.php:9
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento
Magento\AdminNotification\Controller\Adminhtml\Notification
Definition:
MarkAsReadTest.php:6
Magento\AdminNotification\Controller\Adminhtml\Notification
Definition:
Notification.php:14