src/Module/Cms/Action/GetContentAction.php line 28

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Module\Cms\Action;
  4. use Denios\Data\Cms\Story;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  6. /**
  7. * Class GetContentAction
  8. *
  9. * @author André Varelmann <andre.varelmann@bestit-online.de>
  10. * @package App\Module\Cms\Action
  11. */
  12. class GetContentAction
  13. {
  14. public const PAGE_TYPE_STORY = 'story';
  15. /**
  16. * Get product detail
  17. *
  18. * @param Story $cmsContent
  19. * @Template(template="pages/cms/get_content.html.twig")
  20. *
  21. * @return array
  22. */
  23. public function __invoke(Story $cmsContent): array
  24. {
  25. return [
  26. 'cmsContent' => $cmsContent,
  27. 'page_type' => self::PAGE_TYPE_STORY,
  28. ];
  29. }
  30. }