예제 #1
0
 /**
  * @param $id
  * @return string
  * @throws NotFoundHttpException
  */
 public function actionCompanies($id)
 {
     $bank = AbstractBank::findOne($id);
     if (!$bank) {
         throw new NotFoundHttpException('Invalid bank id');
     }
     return $this->render('companies', ['bank' => $bank, 'companyProvider' => new ActiveDataProvider(['query' => Company::find()->with('statuses')->where(['bank_id' => $bank->id])])]);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBank()
 {
     return $this->hasOne(AbstractBank::className(), ['id' => 'bank_id']);
 }