/**
  * Finds the Account model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  *
  * @param int $id
  *
  * @return Account the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $id = Uuid::str2uuid($id);
     $payment = Payment::findOne($id);
     if ($payment === null) {
         throw new NotFoundHttpException('The requested page does not exist');
     }
     return $payment;
 }
 protected function findAccount($id)
 {
     $id = Uuid::str2uuid($id);
     $account = Account::findOne($id);
     if ($account === null) {
         throw new NotFoundHttpException('The requested page does not exist');
     }
     return $account;
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function findModel($id)
 {
     $id = Uuid::str2uuid($id);
     return parent::findModel($id);
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function validateAttribute($model, $attribute)
 {
     $model->{$attribute} = Uuid::str2uuid($model->{$attribute});
 }
 /**
  * Finds the Account model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  *
  * @param int $id
  *
  * @return Account the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $id = Uuid::str2uuid($id);
     $billable = BillableItem::findOne($id);
     if ($billable === null) {
         throw new NotFoundHttpException('The requested page does not exist');
     }
     return $billable;
 }