public function executePersonalNotepad(sfWebRequest $request) { $note = PersonalNotePeer::retrieveByPK($this->getUser()->getId()); if (!$note instanceof PersonalNote) { $note = new PersonalNote(); $note->setPersonId($this->getUser()->getId()); $note->save(); } $this->note = $note; $this->allowed_tags = $this->getAllowedTags(); }
public function executeSavePersonalNote(sfWebRequest $request) { $note = $request->getParameter('note'); $personal_note = PersonalNotePeer::retrieveByPK($this->getUser()->getId()); if (!$personal_note instanceof PersonalNote) { $personal_note = new PersonalNote(); $personal_note->setPersonId($this->getUser()->getId()); } $personal_note->setNote(strip_tags($note, sfConfig::get('app_allowed_note_tags'))); $personal_note->save(); return sfView::NONE; }