_catalogData = $catalogData; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } /** * Initialize resource model * * @return void */ protected function _construct() { $this->_init('Magento\Bundle\Model\ResourceModel\Selection'); parent::_construct(); } /** * Processing object before save data * * @return $this */ public function afterSave() { if (!$this->_catalogData->isPriceGlobal() && $this->getWebsiteId()) { $this->getResource()->saveSelectionPrice($this); if (!$this->getDefaultPriceScope()) { $this->unsSelectionPriceValue(); $this->unsSelectionPriceType(); } } parent::afterSave(); } }