Exemplo n.º 1
0
 protected function findModel($id)
 {
     if (($model = Feed::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 2
0
 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;
 }