public function updateObject($values = null)
 {
     $object = parent::updateObject($values);
     // Do some postvalidation of what parent::updateObject did
     // (it would be nice to turn this into an sfValidator subclass)
     $object->setDescription(aHtml::simplify($object->getDescription(), "<p><br><b><i><strong><em><ul><li><ol><a>"));
     // The tags field is not a native Doctrine field
     // so we can't rely on parent::updateObject to sort out
     // whether to use $values or $this->getValue. So we need
     // to sanitize and figure out what set of values to use
     // (embedded forms get a $values parameter, non-embedded
     // use $this->values)
     if (is_null($values)) {
         $values = $this->values;
     }
     // Now we're ready to play
     // We like all-lowercase tags for consistency
     $values['tags'] = strtolower($values['tags']);
     $object->setTags($values['tags']);
     $object->setOwnerId(sfContext::getInstance()->getUser()->getGuardUser()->getId());
     return $object;
 }
示例#2
0
 /**
  * DOCUMENT ME
  * @param mixed $con
  */
 protected function doSave($con = null)
 {
     $this->updateCategoriesList($this->values);
     parent::doSave($con);
 }