/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'category_id']); }
/** * @return \yii\db\ActiveQuery */ public function getParent() { return $this->hasOne(Category::className(), ['id' => 'parent_id']); }
/** * @inheritdoc */ public function rules() { return [[['category_id', 'filter_type', 'input_type'], 'integer'], [['category_id'], 'exist', 'skipOnError' => true, 'targetClass' => Category::className(), 'targetAttribute' => ['category_id' => 'id']], [['filter_type'], 'exist', 'skipOnError' => true, 'targetClass' => FilterType::className(), 'targetAttribute' => ['filter_type' => 'id']], [['input_type'], 'exist', 'skipOnError' => true, 'targetClass' => FilterInputType::className(), 'targetAttribute' => ['input_type' => 'id']]]; }