Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SetAttributeTabBlockObserver.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
17  protected $helperCatalog;
18 
22  public function __construct(\Magento\Catalog\Helper\Catalog $helperCatalog)
23  {
24  $this->helperCatalog = $helperCatalog;
25  }
26 
33  public function execute(\Magento\Framework\Event\Observer $observer)
34  {
35  $product = $observer->getEvent()->getProduct();
36  if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
37  $this->helperCatalog->setAttributeTabBlock(
38  \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes::class
39  );
40  }
41  return $this;
42  }
43 }
__construct(\Magento\Catalog\Helper\Catalog $helperCatalog)
execute(\Magento\Framework\Event\Observer $observer)