コード例 #1
0
ファイル: components.class.php プロジェクト: yasirgit/afids
 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();
 }
コード例 #2
0
ファイル: BasePerson.php プロジェクト: yasirgit/afids
 /**
  * Gets a single PersonalNote object, which is related to this object by a one-to-one relationship.
  *
  * @param      PropelPDO $con
  * @return     PersonalNote
  * @throws     PropelException
  */
 public function getPersonalNote(PropelPDO $con = null)
 {
     if ($this->singlePersonalNote === null && !$this->isNew()) {
         $this->singlePersonalNote = PersonalNotePeer::retrieveByPK($this->id, $con);
     }
     return $this->singlePersonalNote;
 }
コード例 #3
0
ファイル: actions.class.php プロジェクト: yasirgit/afids
 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;
 }