/** * Return current category Id * * @return integer */ public function getCategoryId() { return parent::getCategoryId() ?: $this->getRootCategoryId(); }