src/Module/Catalog/Action/GetCatalogAction.php line 29

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Module\Catalog\Action;
  4. use Denios\Data\Catalog\Category;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  6. use Symfony\Component\Routing\Annotation\Route;
  7. /**
  8. * Get product listing
  9. *
  10. * @author Michel Chowanski <michel.chowanski@bestit-online.de>
  11. * @package App\Module\Catalog\Action
  12. */
  13. class GetCatalogAction
  14. {
  15. public const PAGE_TYPE_CATEGORY = 'category';
  16. /**
  17. * Get product listing
  18. *
  19. * @Template(template="pages/catalog/get_catalog.html.twig")
  20. *
  21. * @return array
  22. */
  23. #[Route('/catalog', name: 'app_catalog_get_catalog')]
  24. public function __invoke(Category $category, ?array $categorySubTree = null): array
  25. {
  26. return [
  27. 'categoryContent' => [
  28. 'id' => $category->id,
  29. 'headline' => $category->name
  30. ],
  31. 'category' => $category,
  32. 'categorySubTree' => $categorySubTree,
  33. 'test' => 'test',
  34. 'page_type' => self::PAGE_TYPE_CATEGORY,
  35. ];
  36. }
  37. }