Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for licen..
Decoded Output download
<?php
/**
*
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Controller\Adminhtml\Product\Set;
use Magento\Framework\Registry;
use Magento\Backend\App\Action\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Backend\Model\View\Result\Page;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Eav\Api\AttributeSetRepositoryInterface;
use Magento\Catalog\Controller\Adminhtml\Product\Set;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\App\Action\HttpGetActionInterface;
/**
* Edit attribute set controller.
*/
class Edit extends Set implements HttpGetActionInterface
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var AttributeSetRepositoryInterface
*/
private $attributeSetRepository;
/**
* @param Context $context
* @param Registry $coreRegistry
* @param PageFactory $resultPageFactory
* @param AttributeSetRepositoryInterface $attributeSetRepository
*/
public function __construct(
Context $context,
Registry $coreRegistry,
PageFactory $resultPageFactory,
AttributeSetRepositoryInterface $attributeSetRepository = null
) {
parent::__construct($context, $coreRegistry);
$this->resultPageFactory = $resultPageFactory;
$this->attributeSetRepository = $attributeSetRepository ?:
ObjectManager::getInstance()->get(AttributeSetRepositoryInterface::class);
}
/**
* @inheritdoc
*/
public function execute()
{
$this->_setTypeId();
$attributeSet = $this->attributeSetRepository->get($this->getRequest()->getParam('id'));
if (!$attributeSet->getId()) {
return $this->resultRedirectFactory->create()->setPath('catalog/*/index');
}
$this->_coreRegistry->register('current_attribute_set', $attributeSet);
/** @var Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets');
$resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets'));
$resultPage->getConfig()->getTitle()->prepend(
$attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set')
);
$resultPage->addBreadcrumb(__('Catalog'), __('Catalog'));
$resultPage->addBreadcrumb(__('Manage Product Sets'), __('Manage Product Sets'));
return $resultPage;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
*
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Controller\Adminhtml\Product\Set;
use Magento\Framework\Registry;
use Magento\Backend\App\Action\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Backend\Model\View\Result\Page;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\Controller\ResultInterface;
use Magento\Eav\Api\AttributeSetRepositoryInterface;
use Magento\Catalog\Controller\Adminhtml\Product\Set;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\App\Action\HttpGetActionInterface;
/**
* Edit attribute set controller.
*/
class Edit extends Set implements HttpGetActionInterface
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var AttributeSetRepositoryInterface
*/
private $attributeSetRepository;
/**
* @param Context $context
* @param Registry $coreRegistry
* @param PageFactory $resultPageFactory
* @param AttributeSetRepositoryInterface $attributeSetRepository
*/
public function __construct(
Context $context,
Registry $coreRegistry,
PageFactory $resultPageFactory,
AttributeSetRepositoryInterface $attributeSetRepository = null
) {
parent::__construct($context, $coreRegistry);
$this->resultPageFactory = $resultPageFactory;
$this->attributeSetRepository = $attributeSetRepository ?:
ObjectManager::getInstance()->get(AttributeSetRepositoryInterface::class);
}
/**
* @inheritdoc
*/
public function execute()
{
$this->_setTypeId();
$attributeSet = $this->attributeSetRepository->get($this->getRequest()->getParam('id'));
if (!$attributeSet->getId()) {
return $this->resultRedirectFactory->create()->setPath('catalog/*/index');
}
$this->_coreRegistry->register('current_attribute_set', $attributeSet);
/** @var Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets');
$resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets'));
$resultPage->getConfig()->getTitle()->prepend(
$attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set')
);
$resultPage->addBreadcrumb(__('Catalog'), __('Catalog'));
$resultPage->addBreadcrumb(__('Manage Product Sets'), __('Manage Product Sets'));
return $resultPage;
}
}
Function Calls
None |
Stats
MD5 | 1e29d2d53c1a90bae51520dc515e6ef8 |
Eval Count | 0 |
Decode Time | 99 ms |