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