public function save($con = null, $parent = null) { try { $con = Propel::getConnection(); $con->begin(); if (!$this->getId()) { $this->setId(Document::getGenericDocument($this)->getId()); } parent::save($con); // create relationship if (!$parent && !Document::getParentOf($this->getId())) { $parent = Rootfolder::getRootfolder($this); } Relation::saveRelation($parent, $this); $con->commit(); Document::cacheObj($this, get_class($this)); return true; } catch (Exception $e) { $con->rollback(); throw $e; } }