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-cms
Controller
Adminhtml
Page
MassDelete.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Cms\Controller\Adminhtml\Page
;
7
8
use
Magento\Framework\Controller\ResultFactory
;
9
use
Magento\Backend\App\Action\Context
;
10
use
Magento\Ui\Component\MassAction\Filter
;
11
use Magento\Cms\Model\ResourceModel\Page\CollectionFactory;
12
16
class
MassDelete
extends
\Magento\Backend\App\Action
17
{
23
const
ADMIN_RESOURCE
=
'Magento_Cms::page_delete'
;
24
28
protected
$filter
;
29
33
protected
$collectionFactory
;
34
40
public
function
__construct
(
Context
$context,
Filter
$filter
, CollectionFactory
$collectionFactory
)
41
{
42
$this->filter =
$filter
;
43
$this->collectionFactory =
$collectionFactory
;
44
parent::__construct($context);
45
}
46
53
public
function
execute
()
54
{
55
$collection
= $this->filter->getCollection($this->collectionFactory->create());
56
$collectionSize =
$collection
->getSize();
57
58
foreach
(
$collection
as
$page
) {
59
$page
->delete();
60
}
61
62
$this->messageManager->addSuccessMessage(
__
(
'A total of %1 record(s) have been deleted.'
, $collectionSize));
63
65
$resultRedirect = $this->resultFactory->create(
ResultFactory::TYPE_REDIRECT
);
66
67
return
$resultRedirect->setPath(
'*/*/'
);
68
}
69
}
Magento\Cms\Controller\Adminhtml\Page\MassDelete\$filter
$filter
Definition:
MassDelete.php:28
Magento\Ui\Component\MassAction\Filter
Definition:
Filter.php:21
Magento\Cms\Controller\Adminhtml\Page\MassDelete\$collectionFactory
$collectionFactory
Definition:
MassDelete.php:33
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
__
__()
Definition:
__.php:13
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
$page
$page
Definition:
pages.php:8
Magento\Cms\Controller\Adminhtml\Page\MassDelete\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
MassDelete.php:23
Magento\Cms\Controller\Adminhtml\Page\MassDelete
Definition:
MassDelete.php:16
Magento\Framework\Controller\ResultFactory\TYPE_REDIRECT
const TYPE_REDIRECT
Definition:
ResultFactory.php:24
Magento\Backend\App\Action\Context
Definition:
Context.php:25
Magento\Cms\Controller\Adminhtml\Page
Definition:
Delete.php:7
Magento\Cms\Controller\Adminhtml\Page\MassDelete\__construct
__construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
Definition:
MassDelete.php:40
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17