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