NewAction.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Search\Controller\Adminhtml\Synonyms;
  7. class NewAction extends \Magento\Backend\App\Action
  8. {
  9. /**
  10. * Authorization level of a basic admin session
  11. *
  12. * @see _isAllowed()
  13. */
  14. const ADMIN_RESOURCE = 'Magento_Search::synonyms';
  15. /**
  16. * @var \Magento\Backend\Model\View\Result\ForwardFactory $forwardFactory
  17. */
  18. private $forwardFactory;
  19. /**
  20. * New Synonym Group Action constructor.
  21. *
  22. * @param \Magento\Backend\App\Action\Context $context
  23. * @param \Magento\Backend\Model\View\Result\ForwardFactory $forwardFactory
  24. */
  25. public function __construct(
  26. \Magento\Backend\App\Action\Context $context,
  27. \Magento\Backend\Model\View\Result\ForwardFactory $forwardFactory
  28. ) {
  29. $this->forwardFactory = $forwardFactory;
  30. parent::__construct($context);
  31. }
  32. /**
  33. * Create new synonyms group action
  34. *
  35. * @return \Magento\Backend\Model\View\Result\Forward
  36. */
  37. public function execute()
  38. {
  39. $forward = $this->forwardFactory->create();
  40. $forward->forward('edit');
  41. return $forward;
  42. }
  43. }