public function save($con = null)
 {
     $result = parent::save($con);
     if ($this->isNew()) {
         opCommunityTopicToolkit::sendNotificationMail($result->getCommunity(), $result->getId(), 'topic', $result->getMember()->getName(), $result->getName(), $result->getBody());
     }
     return $result;
 }
 public function updateObject($values = null)
 {
     $object = parent::updateObject($values);
     foreach ($this->embeddedForms as $key => $form) {
         if (!($form->getObject() && $form->getObject()->File != null)) {
             unset($this->embeddedForms[$key]);
         }
     }
     return $object;
 }
 public function setup()
 {
     parent::setup();
     unset($this['id']);
     unset($this['community_id']);
     unset($this['member_id']);
     unset($this['created_at']);
     unset($this['updated_at']);
     unset($this['topic_updated_at']);
     $this->setWidget('name', new sfWidgetFormInput());
     $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('community_topic_form');
 }