예제 #1
0
파일: User.php 프로젝트: bagaswidodo/ta-app
 public static function findIdentity($kd_dosen)
 {
     //mencari user login berdasarkan IDnya dan hanya dicari 1.
     $user = Dosen::findOne(['kd_dosen' => $kd_dosen]);
     if (count($user)) {
         return new static($user);
         // return valid;
     }
     return null;
 }
예제 #2
0
 /**
  * Finds the Dosen model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Dosen the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Dosen::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }