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
Index
AbstractMassAction.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Customer\Controller\Adminhtml\Index
;
7
8
use
Magento\Eav\Model\Entity\Collection\AbstractCollection
;
9
use
Magento\Framework\Controller\ResultFactory
;
10
use
Magento\Framework\App\ResponseInterface
;
11
use
Magento\Framework\Controller\ResultInterface
;
12
use
Magento\Backend\App\Action\Context
;
13
use
Magento\Ui\Component\MassAction\Filter
;
14
use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory;
15
19
abstract
class
AbstractMassAction
extends
\Magento\Backend\App\Action
20
{
26
const
ADMIN_RESOURCE
=
'Magento_Customer::manage'
;
27
31
protected
$redirectUrl
=
'*/*/index'
;
32
36
protected
$filter
;
37
41
protected
$collectionFactory
;
42
48
public
function
__construct
(
Context
$context,
Filter
$filter
, CollectionFactory
$collectionFactory
)
49
{
50
parent::__construct($context);
51
$this->filter =
$filter
;
52
$this->collectionFactory =
$collectionFactory
;
53
}
54
61
public
function
execute
()
62
{
63
try
{
64
$collection
= $this->filter->getCollection($this->collectionFactory->create());
65
return
$this->
massAction
(
$collection
);
66
}
catch
(\Exception $e) {
67
$this->messageManager->addError($e->getMessage());
69
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
70
return
$resultRedirect->setPath($this->redirectUrl);
71
}
72
}
73
80
protected
function
getComponentRefererUrl
()
81
{
82
return
$this->filter->getComponentRefererUrl()?:
'customer/*/index'
;
83
}
84
91
abstract
protected
function
massAction
(
AbstractCollection
$collection
);
92
}
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\massAction
massAction(AbstractCollection $collection)
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\$redirectUrl
$redirectUrl
Definition:
AbstractMassAction.php:31
Magento\Ui\Component\MassAction\Filter
Definition:
Filter.php:21
Magento\Customer\Controller\Adminhtml\Index
Definition:
MassAssignGroupTest.php:8
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\getComponentRefererUrl
getComponentRefererUrl()
Definition:
AbstractMassAction.php:80
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
Magento\Framework\Controller\ResultInterface
Definition:
ResultInterface.php:19
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\$filter
$filter
Definition:
AbstractMassAction.php:36
Magento\Eav\Model\Entity\Collection\AbstractCollection
Definition:
AbstractCollection.php:23
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\__construct
__construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
Definition:
AbstractMassAction.php:48
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\$collectionFactory
$collectionFactory
Definition:
AbstractMassAction.php:41
Magento\Backend\App\Action\Context
Definition:
Context.php:25
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
AbstractMassAction.php:26
Magento\Customer\Controller\Adminhtml\Index\AbstractMassAction
Definition:
AbstractMassAction.php:19
Magento\Framework\App\ResponseInterface
Definition:
ResponseInterface.php:14
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17