29 lines
592 B
PHP
29 lines
592 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\GraphQLBundle\ApiPublic\Controller;
|
|
|
|
use KupShop\GraphQLBundle\ApiPublic\Types\Content\Page;
|
|
use KupShop\GraphQLBundle\ApiPublic\Util\MenuUtil;
|
|
use TheCodingMachine\GraphQLite\Annotations\Query;
|
|
|
|
class PageController
|
|
{
|
|
public function __construct(
|
|
private readonly MenuUtil $menuUtil,
|
|
) {
|
|
}
|
|
|
|
/**
|
|
* Stránky.
|
|
*
|
|
* @return Page[]
|
|
*/
|
|
#[Query]
|
|
public function pages(?string $label = null, ?int $parentId = null): array
|
|
{
|
|
return $this->menuUtil->getPages($label, $parentId);
|
|
}
|
|
}
|