<?php

namespace common\modules\product\behaviors;


use common\modules\product\models\ProductOption;
use common\modules\rubrication\models\TaxGroup;
use common\modules\rubrication\models\TaxOption;
use yii\base\Behavior;

use Yii;


class FilterBehavior extends Behavior {

    public function getFilters(){

        return $this->owner->hasMany(TaxOption::className(), ['tax_option_id' => 'option_id'])
            ->viaTable(ProductOption::tableName(),[ 'product_id'=> $this->owner->tableSchema->primaryKey[0]])
            ->joinWith('taxGroup')->all();
    }


}