/** * Finds the Przedmiot model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @param integer $kierunekStudiow_id * @param integer $user_id * @return Przedmiot the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Przedmiot::findOne(['id' => $id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public static function idAutora($id) { $result = Przedmiot::findOne(['id' => $id])->user_id; return $result; }