public function save($data) { $transaction = $this->beginTransaction(); try { if (!$this->isPersistent()) { $entity = new Entity(); $entity->setAlias($this->getEntry()); $entity->setType('ST'); $entity->save(); $entry = new Entry(); $entry->newEntry($this->getEntry()); $this->setIdEntity($entity->getId()); if ($data->idSuperType) { $superType = new SemanticType($data->idSuperType); $this->setIdDomain($superType->getIdDomain()); Base::createEntityRelation($entity->getId(), 'rel_subtypeof', $superType->getIdEntity()); } } parent::save(); $transaction->commit(); } catch (\Exception $e) { $transaction->rollback(); throw new \Exception($e->getMessage()); } }