Example #1
0
 private function getCategoriesListIds($id)
 {
     $arr = [];
     $models = InfoCategories::find()->andWhere(['info_id' => $id])->all();
     foreach ($models as $model) {
         $arr[] = $model->category_id;
     }
     return $arr;
 }
Example #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCategories()
 {
     return $this->hasMany(InfoCategories::className(), ['info_id' => 'id']);
 }