public function delete($con = null, $preserveTopic = true)
 {
     if (!$con) {
         $con = Propel::getConnection();
     }
     try {
         $con->begin();
         parent::delete($con);
         $topic = $this->getsfSimpleForumTopic();
         if ($preserveTopic) {
             $topic->leaveUpdatedAtUnchanged();
         }
         $latestPost = $topic->getLatestPostByQuery();
         $topic->updateReplies($latestPost, $con);
         $con->commit();
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
 public function delete(Doctrine_Connection $conn = null)
 {
     if (!$conn) {
         $conn = Doctrine_Manager::connection();
     }
     try {
         $conn->beginTransaction();
         parent::delete($conn);
         $topic = $this->getsfSimpleForumTopic();
         if (isset($preserveTopic)) {
             $topic->leaveUpdatedAtUnchanged();
         }
         $latestPost = $topic->getLatestPostByQuery();
         $topic->updateReplies($latestPost, $conn);
         $conn->commit();
     } catch (Exception $e) {
         $conn->rollback();
         throw $e;
     }
 }
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new sfSimpleForumPostPeer();
     }
     return self::$peer;
 }