Beispiel #1
0
 public function isInterestedIn($question)
 {
     $interest = new Interest();
     $interest->setQuestion($question);
     $interest->setUserId($this->getId());
     $interest->save();
 }
Beispiel #2
0
 public function actionAdd_interest()
 {
     $interest = new Interest();
     $interest->title = $_POST['title'];
     $interest->content = $_POST['content'];
     $interest->port = $_POST['port'];
     $interest->save();
     //$this->redirect(Yii::app()->request->urlReferrer);
     echo 1;
     //                        echo CJSON::encode(array('title'=>$_POST['title'], 'area'=>$_POST['area'], 'port'=>$_POST['port']));//Yii 的方法将数组处理成json数据
 }
Beispiel #3
0
 public function executeInterested()
 {
     $this->question = QuestionPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->question);
     $user = $this->getUser()->getSubscriber();
     $interest = new Interest();
     $interest->setQuestion($this->question);
     $interest->setUser($user);
     $interest->save();
 }