protected function retrieveCategoryFromQueryString() { $categoryId = $this->getRequest()->get('category_id'); $categorySlug = $this->getRequest()->get('category_slug'); if (!$categoryId || !$categorySlug) { return; } return $this->getCategoryManager()->findOneBy(array('id' => $categoryId, 'enabled' => true)); }