Subscriber.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Newsletter subscribe controller
  8. */
  9. namespace Magento\Newsletter\Controller;
  10. use Magento\Framework\App\Action\Context;
  11. use Magento\Store\Model\StoreManagerInterface;
  12. use Magento\Customer\Model\Session;
  13. use Magento\Newsletter\Model\SubscriberFactory;
  14. use Magento\Customer\Model\Url as CustomerUrl;
  15. abstract class Subscriber extends \Magento\Framework\App\Action\Action
  16. {
  17. /**
  18. * Customer session
  19. *
  20. * @var Session
  21. */
  22. protected $_customerSession;
  23. /**
  24. * Subscriber factory
  25. *
  26. * @var SubscriberFactory
  27. */
  28. protected $_subscriberFactory;
  29. /**
  30. * @var \Magento\Store\Model\StoreManagerInterface
  31. */
  32. protected $_storeManager;
  33. /**
  34. * @var CustomerUrl
  35. */
  36. protected $_customerUrl;
  37. /**
  38. * @param Context $context
  39. * @param SubscriberFactory $subscriberFactory
  40. * @param Session $customerSession
  41. * @param StoreManagerInterface $storeManager
  42. * @param CustomerUrl $customerUrl
  43. */
  44. public function __construct(
  45. Context $context,
  46. SubscriberFactory $subscriberFactory,
  47. Session $customerSession,
  48. StoreManagerInterface $storeManager,
  49. CustomerUrl $customerUrl
  50. ) {
  51. parent::__construct($context);
  52. $this->_storeManager = $storeManager;
  53. $this->_subscriberFactory = $subscriberFactory;
  54. $this->_customerSession = $customerSession;
  55. $this->_customerUrl = $customerUrl;
  56. }
  57. }