Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Edit.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
11 
12 class Edit extends RatingController implements HttpGetActionInterface
13 {
17  public function execute()
18  {
19  $this->initEntityId();
21  $ratingModel = $this->_objectManager->create(\Magento\Review\Model\Rating::class);
22  if ($this->getRequest()->getParam('id')) {
23  $ratingModel->load($this->getRequest()->getParam('id'));
24  }
26  $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
27  $resultPage->setActiveMenu('Magento_Review::catalog_reviews_ratings_ratings');
28  $resultPage->getConfig()->getTitle()->prepend(__('Ratings'));
29  $resultPage->getConfig()->getTitle()->prepend(
30  $ratingModel->getId() ? $ratingModel->getRatingCode() : __('New Rating')
31  );
32  $resultPage->addBreadcrumb(__('Manage Ratings'), __('Manage Ratings'));
33  $resultPage->addContent($resultPage->getLayout()->createBlock(
34  \Magento\Review\Block\Adminhtml\Rating\Edit::class
35  ))->addLeft($resultPage->getLayout()->createBlock(\Magento\Review\Block\Adminhtml\Rating\Edit\Tabs::class));
36  return $resultPage;
37  }
38 }
__()
Definition: __.php:13