Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
UpdateExcludedFieldListObserver.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Weee\Observer;
7 
9 
11 {
15  protected $weeeTax;
16 
20  public function __construct(\Magento\Weee\Model\Tax $weeeTax)
21  {
22  $this->weeeTax = $weeeTax;
23  }
24 
31  public function execute(\Magento\Framework\Event\Observer $observer)
32  {
33  //adminhtml_catalog_product_form_prepare_excluded_field_list
34 
35  $block = $observer->getEvent()->getObject();
36  $list = $block->getFormExcludedFieldList();
37  $attributes = $this->weeeTax->getWeeeAttributeCodes(true);
38  $list = array_merge($list, array_values($attributes));
39 
40  $block->setFormExcludedFieldList($list);
41 
42  return $this;
43  }
44 }
$block
Definition: block.php:8
$attributes
Definition: matrix.phtml:13