コード例 #1
0
ファイル: Ticket.php プロジェクト: yodathedark/moltis-tickets
 public function getAccessCodes()
 {
     return $this->hasMany(AccessCode::className(), ['ticket_id' => 'id']);
 }
コード例 #2
0
 public function getAccessCode()
 {
     return $this->hasOne(AccessCode::className(), ['id', 'access_code_id']);
 }
コード例 #3
0
 /**
  * Finds the AccessCode model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return AccessCode the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = AccessCode::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }