* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShopBundle\Controller\Api; use PrestaShopBundle\Entity\Repository\CategoryRepository; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; class CategoryController extends ApiController { /** * @var CategoryRepository */ public $categoryRepository; /** * @param Request $request * * @return JsonResponse */ public function listCategoriesAction(Request $request) { return $this->jsonResponse($this->categoryRepository->getCategories(true), $request); } }