public static function getProjectName($id) { if (($model = Project::findOne($id)) !== null) { return $model->name; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
protected function findProjectmodel($id) { if (($model = Project::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested project does not exist.'); } }