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