Esempio n. 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(FinanceCategories::className(), ['finance_id' => 'id']);
 }
Esempio n. 2
0
 private function getCategoriesListIds($id)
 {
     $arr = [];
     $finances = FinanceCategories::find()->andWhere(['finance_id' => $id])->all();
     foreach ($finances as $finance) {
         $arr[] = $finance->category_id;
     }
     return $arr;
 }