/** * Relations */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'cid'])->where(['status' => Category::STATUS_ACTIVE]); }
/** * Relations */ public function getParent() { return $this->hasOne(Category::className(), ['id' => 'pid'])->where(['status' => self::STATUS_ACTIVE]); }