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-customer
Controller
Adminhtml
Group
Delete.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Customer\Controller\Adminhtml\Group
;
8
9
use
Magento\Framework\App\Action\HttpPostActionInterface
;
10
use
Magento\Framework\Exception\NoSuchEntityException
;
11
12
class
Delete
extends
\Magento\Customer\Controller\Adminhtml\Group
implements
HttpPostActionInterface
13
{
19
public
function
execute
()
20
{
21
$id
= $this->
getRequest
()->getParam(
'id'
);
23
$resultRedirect = $this->resultRedirectFactory->create();
24
if
(
$id
) {
25
try
{
26
$this->groupRepository->deleteById(
$id
);
27
$this->messageManager->addSuccess(
__
(
'You deleted the customer group.'
));
28
}
catch
(
NoSuchEntityException
$e) {
29
$this->messageManager->addError(
__
(
'The customer group no longer exists.'
));
30
return
$resultRedirect->setPath(
'customer/*/'
);
31
}
catch
(\Exception $e) {
32
$this->messageManager->addError($e->getMessage());
33
return
$resultRedirect->setPath(
'customer/group/edit'
, [
'id'
=>
$id
]);
34
}
35
}
36
return
$resultRedirect->setPath(
'customer/group'
);
37
}
38
}
$id
$id
Definition:
fieldset.phtml:14
__
__()
Definition:
__.php:13
Magento\Customer\Controller\Adminhtml\Group
Definition:
Delete.php:7
Magento\Framework\App\Action\AbstractAction\getRequest
getRequest()
Definition:
AbstractAction.php:60
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Customer\Controller\Adminhtml\Group\Delete
Definition:
Delete.php:12
Magento\Framework\App\Action\HttpPostActionInterface
Definition:
HttpPostActionInterface.php:16
Magento\Customer\Controller\Adminhtml\Group
Definition:
Group.php:14
Magento\Framework\Exception\NoSuchEntityException
Definition:
NoSuchEntityException.php:16