Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Additional.php
Go to the documentation of this file.
1 <?php
7 
14 {
19 
24 
31 
41  public function __construct(
42  \Magento\Framework\View\Element\Template\Context $context,
43  \Magento\Customer\Helper\View $customerViewHelper,
44  \Magento\Persistent\Helper\Session $persistentSessionHelper,
45  \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
46  array $data = []
47  ) {
48  $this->isScopePrivate = true;
49  $this->_customerViewHelper = $customerViewHelper;
50  $this->_persistentSessionHelper = $persistentSessionHelper;
51  $this->customerRepository = $customerRepository;
52  parent::__construct($context, $data);
53  $this->_isScopePrivate = true;
54  }
55 
61  public function getHref()
62  {
63  return $this->getUrl('persistent/index/unsetCookie');
64  }
65 
71  protected function _toHtml()
72  {
73  if ($this->_persistentSessionHelper->getSession()->getCustomerId()) {
74  return '<span><a ' . $this->getLinkAttributes() . ' >' . __('Not you?')
75  . '</a></span>';
76  }
77 
78  return '';
79  }
80 }
__()
Definition: __.php:13
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Helper\View $customerViewHelper, \Magento\Persistent\Helper\Session $persistentSessionHelper, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, array $data=[])
Definition: Additional.php:41