コード例 #1
0
ファイル: FeedController.php プロジェクト: awebc/web_xbf
 protected function findModel($id)
 {
     if (($model = Feed::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
ファイル: Comment.php プロジェクト: awebc/web_xbf
 public function getTarget()
 {
     switch ($this->obj_type) {
         case App::OBJ_TYPE_FEED:
             $target = Feed::findOne($this->obj_id);
             break;
         default:
             $target = null;
             break;
     }
     return $target;
 }