if (!empty($categoryId)) {
            $category = Yii::app()->getComponent('categoriesRepository')->getById($categoryId);
            if (null === $category) {
                throw new CHttpException(404);
            }