Produced by Araxis Merge on 2023-07-12 04:42:38 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.5/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Controller/Adminhtml/Dailydeal | MassDelete.php | 2018-03-14 03:44:04 +0000 |
| 2 | Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Dailydeals/Controller/Adminhtml/Dailydeal | MassDelete.php | 2018-03-14 03:44:04 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 118 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | namespace Smartwave\Dailydeals\Controller\Adminhtml\Dailydeal; | 2 | namespace Smartwave\Dailydeals\Controller\Adminhtml\Dailydeal; | |||
| 3 | 3 | |||||
| 4 | class MassDelete extends \Magento\Backend\App\Action | 4 | class MassDelete extends \Magento\Backend\App\Action | |||
| 5 | { | 5 | { | |||
| 6 | /** | 6 | /** | |||
| 7 | * Mass Action Filter | 7 | * Mass Action Filter | |||
| 8 | * | 8 | * | |||
| 9 | * @var \Magento\Ui\Component\MassAction\Filter | 9 | * @var \Magento\Ui\Component\MassAction\Filter | |||
| 10 | */ | 10 | */ | |||
| 11 | protected $filter; | 11 | protected $filter; | |||
| 12 | 12 | |||||
| 13 | /** | 13 | /** | |||
| 14 | * Collection Factory | 14 | * Collection Factory | |||
| 15 | * | 15 | * | |||
| 16 | * @var \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory | 16 | * @var \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory | |||
| 17 | */ | 17 | */ | |||
| 18 | protected $collectionFactory; | 18 | protected $collectionFactory; | |||
| 19 | 19 | |||||
| 20 | /** | 20 | /** | |||
| 21 | * constructor | 21 | * constructor | |||
| 22 | * | 22 | * | |||
| 23 | * @param \Magento\Ui\Component\MassAction\Filter $filter | 23 | * @param \Magento\Ui\Component\MassAction\Filter $filter | |||
| 24 | * @param \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory $collectionFactory | 24 | * @param \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory $collectionFactory | |||
| 25 | * @param \Magento\Backend\App\Action\Context $context | 25 | * @param \Magento\Backend\App\Action\Context $context | |||
| 26 | */ | 26 | */ | |||
| 27 | public function __construct( | 27 | public function __construct( | |||
| 28 | \Magento\Ui\Component\MassAction\Filter $filter, | 28 | \Magento\Ui\Component\MassAction\Filter $filter, | |||
| 29 | \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory $collectionFactory, | 29 | \Smartwave\Dailydeals\Model\ResourceModel\Dailydeal\CollectionFactory $collectionFactory, | |||
| 30 | \Magento\Backend\App\Action\Context $context | 30 | \Magento\Backend\App\Action\Context $context | |||
| 31 | ) { | 31 | ) { | |||
| 32 | 32 | |||||
| 33 | $this->filter = $filter; | 33 | $this->filter = $filter; | |||
| 34 | $this->collectionFactory = $collectionFactory; | 34 | $this->collectionFactory = $collectionFactory; | |||
| 35 | parent::__construct($context); | 35 | parent::__construct($context); | |||
| 36 | } | 36 | } | |||
| 37 | 37 | |||||
| 38 | 38 | |||||
| 39 | /** | 39 | /** | |||
| 40 | * execute action | 40 | * execute action | |||
| 41 | * | 41 | * | |||
| 42 | * @return \Magento\Backend\Model\View\Result\Redirect | 42 | * @return \Magento\Backend\Model\View\Result\Redirect | |||
| 43 | */ | 43 | */ | |||
| 44 | public function execute() | 44 | public function execute() | |||
| 45 | { | 45 | { | |||
| 46 | $collection = $this->filter->getCollection($this->collectionFactory->create()); | 46 | $collection = $this->filter->getCollection($this->collectionFactory->create()); | |||
| 47 | 47 | |||||
| 48 | $delete = 0; | 48 | $delete = 0; | |||
| 49 | foreach ($collection as $item) { | 49 | foreach ($collection as $item) { | |||
| 50 | /** @var \Smartwave\Dailydeals\Model\Dailydeal $item */ | 50 | /** @var \Smartwave\Dailydeals\Model\Dailydeal $item */ | |||
| 51 | $item->delete(); | 51 | $item->delete(); | |||
| 52 | $delete++; | 52 | $delete++; | |||
| 53 | } | 53 | } | |||
| 54 | $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $delete)); | 54 | $this->messageManager->addSuccess(__('A total of %1 record(s) have been deleted.', $delete)); | |||
| 55 | /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ | 55 | /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ | |||
| 56 | $resultRedirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT); | 56 | $resultRedirect = $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_REDIRECT); | |||
| 57 | return $resultRedirect->setPath('*/*/'); | 57 | return $resultRedirect->setPath('*/*/'); | |||
| 58 | } | 58 | } | |||
| 59 | } | 59 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.