Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SaveGoogleExperimentScriptObserver.php
Go to the documentation of this file.
1 <?php
9 
11 
13 {
17  protected $_category;
18 
25  protected function _initEntity($observer)
26  {
27  $this->_category = $observer->getEvent()->getCategory();
28  }
29 
35  protected function _isGoogleExperimentActive()
36  {
37  return $this->_helper->isGoogleExperimentActive($this->_category->getStoreId());
38  }
39 
45  protected function _getCodeData()
46  {
47  return [
49  'entity_id' => $this->_category->getId(),
50  'store_id' => $this->_category->getStoreId(),
51  'experiment_script' => $this->_params['experiment_script']
52  ];
53  }
54 }