Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Sharing.php
Go to the documentation of this file.
1 <?php
13 
19 {
25  protected $_enteredData = null;
26 
32  protected $_wishlistConfig;
33 
37  protected $_wishlistSession;
38 
45  public function __construct(
46  \Magento\Framework\View\Element\Template\Context $context,
47  \Magento\Wishlist\Model\Config $wishlistConfig,
48  \Magento\Framework\Session\Generic $wishlistSession,
49  array $data = []
50  ) {
51  $this->_wishlistConfig = $wishlistConfig;
52  $this->_wishlistSession = $wishlistSession;
53  parent::__construct($context, $data);
54  }
55 
61  protected function _prepareLayout()
62  {
63  $this->pageConfig->getTitle()->set(__('Wish List Sharing'));
64  }
65 
71  public function getSendUrl()
72  {
73  return $this->getUrl('wishlist/index/send');
74  }
75 
82  public function getEnteredData($key)
83  {
84  if ($this->_enteredData === null) {
85  $this->_enteredData = $this->_wishlistSession->getData('sharing_form', true);
86  }
87 
88  if (!$this->_enteredData || !isset($this->_enteredData[$key])) {
89  return null;
90  } else {
91  return $this->escapeHtml($this->_enteredData[$key]);
92  }
93  }
94 
100  public function getBackUrl()
101  {
102  return $this->getUrl('wishlist');
103  }
104 
110  public function getEmailSharingLimit()
111  {
112  return $this->_wishlistConfig->getSharingEmailLimit();
113  }
114 
120  public function getTextSharingLimit()
121  {
122  return $this->_wishlistConfig->getSharingTextLimit();
123  }
124 }
__()
Definition: __.php:13
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Wishlist\Model\Config $wishlistConfig, \Magento\Framework\Session\Generic $wishlistSession, array $data=[])
Definition: Sharing.php:45