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;
}