public function addViewForUser($user_id) { //check if there is not already a topic view for this user if (sfSimpleForumTopicViewPeer::retrieveByPk($user_id, $this->getId())) { return; } $topicView = new sfSimpleForumTopicView(); $topicView->setTopicId($this->getId()); $topicView->setUserId($user_id); $topicView->save(); }
public function addViewForUser($user_id) { //check if there is not already a topic view for this user $topic = Doctrine::getTable('sfSimpleForumTopicView')->find(array($user_id, $this->getId())); if ($topic instanceof sfSimpleForumTopicView) { return; } $topicView = new sfSimpleForumTopicView(); $topicView->setTopicId($this->getId()); $topicView->setUserId($user_id); $topicView->save(); }
public function addsfSimpleForumTopicView(sfSimpleForumTopicView $l) { $this->collsfSimpleForumTopicViews[] = $l; $l->setsfGuardUser($this); }