Newsletter.php 935 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Block;
  7. use Magento\Customer\Api\AccountManagementInterface;
  8. use Magento\Customer\Api\CustomerRepositoryInterface;
  9. /**
  10. * Customer front newsletter manage block
  11. *
  12. * @api
  13. * @SuppressWarnings(PHPMD.DepthOfInheritance)
  14. * @since 100.0.2
  15. */
  16. class Newsletter extends \Magento\Customer\Block\Account\Dashboard
  17. {
  18. /**
  19. * @var string
  20. */
  21. protected $_template = 'Magento_Customer::form/newsletter.phtml';
  22. /**
  23. * @return bool
  24. * @SuppressWarnings(PHPMD.BooleanGetMethodName)
  25. */
  26. public function getIsSubscribed()
  27. {
  28. return $this->getSubscriptionObject()->isSubscribed();
  29. }
  30. /**
  31. * Return the save action Url.
  32. *
  33. * @return string
  34. */
  35. public function getAction()
  36. {
  37. return $this->getUrl('newsletter/manage/save');
  38. }
  39. }