AddAttribute.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\ConfigurableProduct\Controller\Adminhtml\Product;
  8. use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
  9. use Magento\Backend\App\Action;
  10. use Magento\Framework\Controller\ResultFactory;
  11. class AddAttribute extends Action implements HttpGetActionInterface
  12. {
  13. /**
  14. * Authorization level of a basic admin session
  15. *
  16. * @see _isAllowed()
  17. */
  18. const ADMIN_RESOURCE = 'Magento_Catalog::products';
  19. /**
  20. * @var \Magento\Catalog\Controller\Adminhtml\Product\Builder
  21. */
  22. protected $productBuilder;
  23. /**
  24. * @param Action\Context $context
  25. * @param \Magento\Catalog\Controller\Adminhtml\Product\Builder $productBuilder
  26. */
  27. public function __construct(
  28. \Magento\Backend\App\Action\Context $context,
  29. \Magento\Catalog\Controller\Adminhtml\Product\Builder $productBuilder
  30. ) {
  31. $this->productBuilder = $productBuilder;
  32. parent::__construct($context);
  33. }
  34. /**
  35. * @inheritdoc
  36. */
  37. public function execute()
  38. {
  39. $this->productBuilder->build($this->getRequest());
  40. return $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
  41. }
  42. }