1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Copyright © Getnet. All rights reserved. |
4
|
|
|
* |
5
|
|
|
* @author Bruno Elisei <[email protected]> |
6
|
|
|
* See LICENSE for license details. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Getnet\SubSellerMagento\Controller\Adminhtml\Subseller; |
10
|
|
|
|
11
|
|
|
use Getnet\SubSellerMagento\Controller\RegistryConstants; |
12
|
|
|
use Magento\Framework\Controller\ResultFactory; |
13
|
|
|
use Magento\Framework\Exception\NoSuchEntityException; |
14
|
|
|
|
15
|
|
|
class Edit extends \Getnet\SubSellerMagento\Controller\Adminhtml\Subseller |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Show Edit Form. |
19
|
|
|
* |
20
|
|
|
* @return \Magento\Backend\Model\View\Result\Page|\Magento\Backend\Model\View\Result\Redirect |
21
|
|
|
*/ |
22
|
|
|
public function execute() |
23
|
|
|
{ |
24
|
|
|
$subSellerId = (int) $this->getRequest()->getParam('subseller'); |
25
|
|
|
|
26
|
|
|
$this->_coreRegistry->register(RegistryConstants::CURRENT_SUB_SELLER_ID, $subSellerId); |
|
|
|
|
27
|
|
|
|
28
|
|
|
try { |
29
|
|
|
$subSellerDataObject = $this->_subSellerRepository->get($subSellerId); |
30
|
|
|
} catch (NoSuchEntityException $e) { |
31
|
|
|
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ |
32
|
|
|
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); |
33
|
|
|
|
34
|
|
|
return $resultRedirect->setPath('*/*/'); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
$resultPage = $this->initResultPage(); |
38
|
|
|
$layout = $resultPage->getLayout(); |
39
|
|
|
|
40
|
|
|
$toolbarSaveBlock = $layout->createBlock(\Getnet\SubSellerMagento\Block\Adminhtml\SubSeller\Toolbar\Save::class) |
41
|
|
|
->assign('header', __('Edit Sub Seller')) |
|
|
|
|
42
|
|
|
->assign( |
43
|
|
|
'form', |
44
|
|
|
$layout->createBlock( |
45
|
|
|
\Getnet\SubSellerMagento\Block\Adminhtml\SubSeller\Form::class, |
46
|
|
|
'subSeller_form' |
47
|
|
|
)->setShowLegend(true) |
|
|
|
|
48
|
|
|
); |
49
|
|
|
|
50
|
|
|
$resultPage->addBreadcrumb( |
51
|
|
|
__('Manage Sub Sellers'), |
52
|
|
|
__('Manage Sub Sellers'), |
53
|
|
|
$this->getUrl('subsller/subseller') |
54
|
|
|
)->addBreadcrumb(__('Edit Sub Seller'), __('Edit Sub Seller')) |
55
|
|
|
->addContent($toolbarSaveBlock); |
56
|
|
|
|
57
|
|
|
$resultPage->getConfig()->getTitle()->prepend(__('Getnet Sub Sellers')); |
58
|
|
|
$resultPage->getConfig()->getTitle()->prepend(__('Sub Seller Code: %1', $subSellerDataObject->getCode())); |
59
|
|
|
|
60
|
|
|
return $resultPage; |
61
|
|
|
} |
62
|
|
|
} |
63
|
|
|
|
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.