/** * @return \yii\db\ActiveQuery */ public function getPriceCategory() { return $this->hasOne(PriceCategory::className(), ['id' => 'price_category_id']); }
/** * @return \yii\db\ActiveQuery */ public function getPriceCategories() { return $this->hasMany(PriceCategory::className(), ['id' => 'price_category_id'])->viaTable('{{%price}}', ['product_id' => 'id']); }