/** * 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; }
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; }