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
MassEnable.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
MassEnable
extends
\Magento\Backend\App\Action
17
{
23
const
ADMIN_RESOURCE
=
'Magento_Cms::save'
;
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
57
foreach
(
$collection
as
$item
) {
58
$item
->setIsActive(
true
);
59
$item
->save();
60
}
61
62
$this->messageManager->addSuccessMessage(
63
__
(
'A total of %1 record(s) have been enabled.'
,
$collection
->getSize())
64
);
65
67
$resultRedirect = $this->resultFactory->create(
ResultFactory::TYPE_REDIRECT
);
68
return
$resultRedirect->setPath(
'*/*/'
);
69
}
70
}
Magento\Cms\Controller\Adminhtml\Page\MassEnable
Definition:
MassEnable.php:16
Magento\Cms\Controller\Adminhtml\Page\MassEnable\$filter
$filter
Definition:
MassEnable.php:28
Magento\Ui\Component\MassAction\Filter
Definition:
Filter.php:21
Magento\Cms\Controller\Adminhtml\Page\MassEnable\$collectionFactory
$collectionFactory
Definition:
MassEnable.php:33
Magento\Framework\Controller\ResultFactory
Definition:
ResultFactory.php:17
__
__()
Definition:
__.php:13
$item
$item
Definition:
partial_invoice.php:27
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Backend\App\Action
Definition:
Action.php:17
Magento\Cms\Controller\Adminhtml\Page\MassEnable\ADMIN_RESOURCE
const ADMIN_RESOURCE
Definition:
MassEnable.php:23
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\MassEnable\__construct
__construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
Definition:
MassEnable.php:40
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17