Rating.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Review\Controller\Adminhtml;
  7. use Magento\Backend\App\Action;
  8. use Magento\Backend\App\Action\Context;
  9. use Magento\Framework\Registry;
  10. /**
  11. * Admin ratings controller
  12. */
  13. abstract class Rating extends Action
  14. {
  15. /**
  16. * Authorization level of a basic admin session
  17. *
  18. * @see _isAllowed()
  19. */
  20. const ADMIN_RESOURCE = 'Magento_Review::ratings';
  21. /**
  22. * Core registry
  23. *
  24. * @var \Magento\Framework\Registry
  25. */
  26. protected $coreRegistry = null;
  27. /**
  28. * @param \Magento\Backend\App\Action\Context $context
  29. * @param \Magento\Framework\Registry $coreRegistry
  30. */
  31. public function __construct(
  32. Context $context,
  33. Registry $coreRegistry
  34. ) {
  35. $this->coreRegistry = $coreRegistry;
  36. parent::__construct($context);
  37. }
  38. /**
  39. * @deprecated 100.3.0 Misspelled method
  40. * @see initEntityId
  41. */
  42. protected function initEnityId()
  43. {
  44. $this->initEntityId();
  45. }
  46. /**
  47. * @return void
  48. */
  49. protected function initEntityId()
  50. {
  51. $this->coreRegistry->register(
  52. 'entityId',
  53. $this->_objectManager->create(\Magento\Review\Model\Rating\Entity::class)->getIdByCode('product')
  54. );
  55. }
  56. }