/** * Saves the key config */ public function save() { DefinitionCache::clear($this); $isUpdate = false; $def = \Zend_Json::decode($this->definition); if ($def && isset($def["title"])) { $this->title = $def["title"]; } else { $this->title = null; } if ($this->getId()) { unset(self::$cache[$this->getId()]); $isUpdate = true; \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.preUpdate", $this); } else { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.preAdd", $this); } $model = parent::save(); if ($isUpdate) { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.postUpdate", $this); } else { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.postAdd", $this); } return $model; }
/** * Saves the key config */ public function save() { DefinitionCache::clear($this); $isUpdate = false; if ($this->getId()) { unset(self::$cache[$this->getId()]); $isUpdate = true; \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.preUpdate", $this); } else { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.preAdd", $this); } $model = parent::save(); if ($isUpdate) { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.postUpdate", $this); } else { \Pimcore::getEventManager()->trigger("object.Classificationstore.keyConfig.postAdd", $this); } return $model; }