예제 #1
0
파일: BaseRole.php 프로젝트: yasirgit/afids
 /**
  * Gets a single TeamNote object, which is related to this object by a one-to-one relationship.
  *
  * @param      PropelPDO $con
  * @return     TeamNote
  * @throws     PropelException
  */
 public function getTeamNote(PropelPDO $con = null)
 {
     if ($this->singleTeamNote === null && !$this->isNew()) {
         $this->singleTeamNote = TeamNotePeer::retrieveByPK($this->id, $con);
     }
     return $this->singleTeamNote;
 }
예제 #2
0
 public function executeSaveTeamNote(sfWebRequest $request)
 {
     $note = $request->getParameter('note');
     $a_role = RolePeer::getByTitle('Admin');
     $id = $a_role->getId();
     # validate
     //$c = new Criteria();
     //$c->add(PersonRolePeer::PERSON_ID, $this->getUser()->getId());
     //$c->add(PersonRolePeer::ROLE_ID, $id);
     //if (PersonRolePeer::doCount($c) == 0) $this->forward404();
     # save
     $team_note = TeamNotePeer::retrieveByPK($id);
     if (!$team_note) {
         $team_note = new TeamNote();
     }
     $team_note->setRoleId($id);
     $team_note->setNote(strip_tags($note, sfConfig::get('app_allowed_note_tags')));
     $team_note->save();
     return sfView::NONE;
 }