ProductOptionExclLang.php 1.51 KB
<?php
    
    namespace artbox\catalog\models;

    use artbox\core\behaviors\SlugBehavior;
    
    /**
     * This is the model class for table "product_option_excl_lang".
     *
     * @property integer           $product_option_excl_id
     *
     * @property ProductOptionExcl $productOptionExcl
     */
    class ProductOptionExclLang extends OptionLang
    {
        /**
         * @inheritdoc
         */
        public static function tableName()
        {
            return 'product_option_excl_lang';
        }
    
        /**
         * @inheritdoc
         */
        public function behaviors()
        {
            return [
                'slug' => [
                    'class'       => SlugBehavior::className(),
                    'inAttribute' => 'value',
                    'action'      => 'product-option-exclusion/view',
                    'params'      => [
                        'id' => 'product_option_excl_id',
                    ],
                    'fields'      => [
                        'title'       => \Yii::t('catalog', 'Option title'),
                        'description' => \Yii::t('catalog', 'Option description'),
                    ],
                ],
            ];
        }
        
        /**
         * @return \yii\db\ActiveQuery
         */
        public function getProductOptionExcl()
        {
            return $this->hasOne(ProductOptionExcl::className(), [ 'id' => 'product_option_excl_id' ])
                        ->inverseOf('productOptionExclLangs');
        }
    }