private function getCategoriesListIds($id) { $arr = []; $abouts = AboutCategories::find()->andWhere(['about_id' => $id])->all(); foreach ($abouts as $about) { $arr[] = $about->category_id; } return $arr; }
/** * @return \yii\db\ActiveQuery */ public function getCategories() { return $this->hasMany(AboutCategories::className(), ['about_id' => 'id']); }