Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DepersonalizePlugin.php
Go to the documentation of this file.
1 <?php
9 
11 
16 {
21 
27  protected $catalogSession;
28 
33  public function __construct(
35  \Magento\Catalog\Model\Session $catalogSession
36  ) {
37  $this->catalogSession = $catalogSession;
38  $this->depersonalizeChecker = $depersonalizeChecker;
39  }
40 
48  public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
49  {
50  if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
51  $this->catalogSession->clearStorage();
52  }
53  return $result;
54  }
55 }
afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
__construct(DepersonalizeChecker $depersonalizeChecker, \Magento\Catalog\Model\Session $catalogSession)