Edit.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Review\Controller\Adminhtml\Rating;
  7. use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
  8. use Magento\Review\Controller\Adminhtml\Rating as RatingController;
  9. use Magento\Framework\Controller\ResultFactory;
  10. class Edit extends RatingController implements HttpGetActionInterface
  11. {
  12. /**
  13. * @return \Magento\Backend\Model\View\Result\Page
  14. */
  15. public function execute()
  16. {
  17. $this->initEntityId();
  18. /** @var \Magento\Review\Model\Rating $ratingModel */
  19. $ratingModel = $this->_objectManager->create(\Magento\Review\Model\Rating::class);
  20. if ($this->getRequest()->getParam('id')) {
  21. $ratingModel->load($this->getRequest()->getParam('id'));
  22. }
  23. /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
  24. $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
  25. $resultPage->setActiveMenu('Magento_Review::catalog_reviews_ratings_ratings');
  26. $resultPage->getConfig()->getTitle()->prepend(__('Ratings'));
  27. $resultPage->getConfig()->getTitle()->prepend(
  28. $ratingModel->getId() ? $ratingModel->getRatingCode() : __('New Rating')
  29. );
  30. $resultPage->addBreadcrumb(__('Manage Ratings'), __('Manage Ratings'));
  31. $resultPage->addContent($resultPage->getLayout()->createBlock(
  32. \Magento\Review\Block\Adminhtml\Rating\Edit::class
  33. ))->addLeft($resultPage->getLayout()->createBlock(\Magento\Review\Block\Adminhtml\Rating\Edit\Tabs::class));
  34. return $resultPage;
  35. }
  36. }