/** * Processing object after save data * * @return $this */ public function afterSave() { if ($this->isObjectNew() && (bool) $this->getData(EavAttributeInterface::IS_USED_IN_GRID)) { $this->_getResource()->addCommitCallback([$this, 'invalidate']); } elseif (!$this->isObjectNew() && $this->dataHasChangedFor(EavAttributeInterface::IS_USED_IN_GRID)) { $this->_getResource()->addCommitCallback([$this, 'invalidate']); } return parent::afterSave(); }