Review.php 799 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Review\CustomerData;
  7. use Magento\Customer\CustomerData\SectionSourceInterface;
  8. /**
  9. * Review section
  10. */
  11. class Review implements SectionSourceInterface
  12. {
  13. /**
  14. * @var \Magento\Framework\Session\Generic
  15. */
  16. protected $reviewSession;
  17. /**
  18. * @param \Magento\Framework\Session\Generic $reviewSession
  19. */
  20. public function __construct(\Magento\Framework\Session\Generic $reviewSession)
  21. {
  22. $this->reviewSession = $reviewSession;
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getSectionData()
  28. {
  29. return (array)$this->reviewSession->getFormData(true) + ['nickname' => '','title' => '', 'detail' => ''];
  30. }
  31. }