<?php
declare(strict_types=1);
namespace App\Module\Catalog\Action;
use Denios\Data\Catalog\Category;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
/**
* Get product listing
*
* @author Michel Chowanski <michel.chowanski@bestit-online.de>
* @package App\Module\Catalog\Action
*/
class GetCatalogAction
{
public const PAGE_TYPE_CATEGORY = 'category';
/**
* Get product listing
*
* @Template(template="pages/catalog/get_catalog.html.twig")
*
* @return array
*/
#[Route('/catalog', name: 'app_catalog_get_catalog')]
public function __invoke(Category $category, ?array $categorySubTree = null): array
{
return [
'categoryContent' => [
'id' => $category->id,
'headline' => $category->name
],
'category' => $category,
'categorySubTree' => $categorySubTree,
'test' => 'test',
'page_type' => self::PAGE_TYPE_CATEGORY,
];
}
}