Share.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Wishlist\Controller\Index;
  7. use Magento\Framework\App\Action;
  8. use Magento\Framework\Controller\ResultFactory;
  9. class Share extends \Magento\Wishlist\Controller\AbstractIndex
  10. {
  11. /**
  12. * @var \Magento\Customer\Model\Session
  13. */
  14. protected $customerSession;
  15. /**
  16. * @param \Magento\Framework\App\Action\Context $context
  17. * @param \Magento\Customer\Model\Session $customerSession
  18. */
  19. public function __construct(
  20. \Magento\Framework\App\Action\Context $context,
  21. \Magento\Customer\Model\Session $customerSession
  22. ) {
  23. $this->customerSession = $customerSession;
  24. parent::__construct($context);
  25. }
  26. /**
  27. * Prepare wishlist for share
  28. *
  29. * @return void|\Magento\Framework\View\Result\Page
  30. */
  31. public function execute()
  32. {
  33. if ($this->customerSession->authenticate()) {
  34. /** @var \Magento\Framework\View\Result\Page $resultPage */
  35. $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
  36. return $resultPage;
  37. }
  38. }
  39. }