vendor/api-platform/core/src/Metadata/Metadata.php line 509

  1. <?php
  2. /*
  3.  * This file is part of the API Platform project.
  4.  *
  5.  * (c) Kévin Dunglas <dunglas@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace ApiPlatform\Metadata;
  12. use ApiPlatform\State\OptionsInterface;
  13. /**
  14.  * @internal
  15.  */
  16. abstract class Metadata
  17. {
  18.     /**
  19.      * @param string|null $deprecationReason       https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
  20.      * @param string|null $security                https://api-platform.com/docs/core/security
  21.      * @param string|null $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
  22.      * @param mixed|null  $mercure
  23.      * @param mixed|null  $messenger
  24.      * @param mixed|null  $input
  25.      * @param mixed|null  $output
  26.      * @param mixed|null  $provider
  27.      * @param mixed|null  $processor
  28.      */
  29.     public function __construct(
  30.         protected ?string $shortName null,
  31.         protected ?string $class null,
  32.         protected ?string $description null,
  33.         protected ?int $urlGenerationStrategy null,
  34.         protected ?string $deprecationReason null,
  35.         protected ?array $normalizationContext null,
  36.         protected ?array $denormalizationContext null,
  37.         protected ?bool $collectDenormalizationErrors null,
  38.         protected ?array $validationContext null,
  39.         protected ?array $filters null,
  40.         protected ?bool $elasticsearch null,
  41.         protected $mercure null,
  42.         protected $messenger null,
  43.         protected $input null,
  44.         protected $output null,
  45.         protected ?array $order null,
  46.         protected ?bool $fetchPartial null,
  47.         protected ?bool $forceEager null,
  48.         protected ?bool $paginationEnabled null,
  49.         protected ?string $paginationType null,
  50.         protected ?int $paginationItemsPerPage null,
  51.         protected ?int $paginationMaximumItemsPerPage null,
  52.         protected ?bool $paginationPartial null,
  53.         protected ?bool $paginationClientEnabled null,
  54.         protected ?bool $paginationClientItemsPerPage null,
  55.         protected ?bool $paginationClientPartial null,
  56.         protected ?bool $paginationFetchJoinCollection null,
  57.         protected ?bool $paginationUseOutputWalkers null,
  58.         protected ?string $security null,
  59.         protected ?string $securityMessage null,
  60.         protected ?string $securityPostDenormalize null,
  61.         protected ?string $securityPostDenormalizeMessage null,
  62.         protected ?string $securityPostValidation null,
  63.         protected ?string $securityPostValidationMessage null,
  64.         protected $provider null,
  65.         protected $processor null,
  66.         protected ?OptionsInterface $stateOptions null,
  67.         protected array $extraProperties = []
  68.     ) {
  69.     }
  70.     public function getShortName(): ?string
  71.     {
  72.         return $this->shortName;
  73.     }
  74.     public function withShortName(string $shortName): static
  75.     {
  76.         $self = clone $this;
  77.         $self->shortName $shortName;
  78.         return $self;
  79.     }
  80.     public function getClass(): ?string
  81.     {
  82.         return $this->class;
  83.     }
  84.     public function withClass(string $class): static
  85.     {
  86.         $self = clone $this;
  87.         $self->class $class;
  88.         return $self;
  89.     }
  90.     public function getDescription(): ?string
  91.     {
  92.         return $this->description;
  93.     }
  94.     public function withDescription(string $description null): static
  95.     {
  96.         $self = clone $this;
  97.         $self->description $description;
  98.         return $self;
  99.     }
  100.     public function getUrlGenerationStrategy(): ?int
  101.     {
  102.         return $this->urlGenerationStrategy;
  103.     }
  104.     public function withUrlGenerationStrategy(int $urlGenerationStrategy): static
  105.     {
  106.         $self = clone $this;
  107.         $self->urlGenerationStrategy $urlGenerationStrategy;
  108.         return $self;
  109.     }
  110.     public function getDeprecationReason(): ?string
  111.     {
  112.         return $this->deprecationReason;
  113.     }
  114.     public function withDeprecationReason($deprecationReason): static
  115.     {
  116.         $self = clone $this;
  117.         $self->deprecationReason $deprecationReason;
  118.         return $self;
  119.     }
  120.     public function getNormalizationContext(): ?array
  121.     {
  122.         return $this->normalizationContext;
  123.     }
  124.     public function withNormalizationContext(array $normalizationContext): static
  125.     {
  126.         $self = clone $this;
  127.         $self->normalizationContext $normalizationContext;
  128.         return $self;
  129.     }
  130.     public function getDenormalizationContext(): ?array
  131.     {
  132.         return $this->denormalizationContext;
  133.     }
  134.     public function withDenormalizationContext(array $denormalizationContext): static
  135.     {
  136.         $self = clone $this;
  137.         $self->denormalizationContext $denormalizationContext;
  138.         return $self;
  139.     }
  140.     public function getCollectDenormalizationErrors(): ?bool
  141.     {
  142.         return $this->collectDenormalizationErrors;
  143.     }
  144.     public function withCollectDenormalizationErrors(bool $collectDenormalizationErrors null): static
  145.     {
  146.         $self = clone $this;
  147.         $self->collectDenormalizationErrors $collectDenormalizationErrors;
  148.         return $self;
  149.     }
  150.     public function getValidationContext(): ?array
  151.     {
  152.         return $this->validationContext;
  153.     }
  154.     public function withValidationContext(array $validationContext): static
  155.     {
  156.         $self = clone $this;
  157.         $self->validationContext $validationContext;
  158.         return $self;
  159.     }
  160.     /**
  161.      * @return string[]|null
  162.      */
  163.     public function getFilters(): ?array
  164.     {
  165.         return $this->filters;
  166.     }
  167.     public function withFilters(array $filters): static
  168.     {
  169.         $self = clone $this;
  170.         $self->filters $filters;
  171.         return $self;
  172.     }
  173.     /**
  174.      * @deprecated this will be removed in v4
  175.      */
  176.     public function getElasticsearch(): ?bool
  177.     {
  178.         return $this->elasticsearch;
  179.     }
  180.     /**
  181.      * @deprecated this will be removed in v4
  182.      */
  183.     public function withElasticsearch(bool $elasticsearch): static
  184.     {
  185.         $self = clone $this;
  186.         $self->elasticsearch $elasticsearch;
  187.         return $self;
  188.     }
  189.     /**
  190.      * @return array|bool|mixed|null
  191.      */
  192.     public function getMercure()
  193.     {
  194.         return $this->mercure;
  195.     }
  196.     public function withMercure($mercure): static
  197.     {
  198.         $self = clone $this;
  199.         $self->mercure $mercure;
  200.         return $self;
  201.     }
  202.     public function getMessenger()
  203.     {
  204.         return $this->messenger;
  205.     }
  206.     public function withMessenger($messenger): static
  207.     {
  208.         $self = clone $this;
  209.         $self->messenger $messenger;
  210.         return $self;
  211.     }
  212.     public function getInput()
  213.     {
  214.         return $this->input;
  215.     }
  216.     public function withInput($input): static
  217.     {
  218.         $self = clone $this;
  219.         $self->input $input;
  220.         return $self;
  221.     }
  222.     public function getOutput()
  223.     {
  224.         return $this->output;
  225.     }
  226.     public function withOutput($output): static
  227.     {
  228.         $self = clone $this;
  229.         $self->output $output;
  230.         return $self;
  231.     }
  232.     public function getOrder(): ?array
  233.     {
  234.         return $this->order;
  235.     }
  236.     public function withOrder(array $order): static
  237.     {
  238.         $self = clone $this;
  239.         $self->order $order;
  240.         return $self;
  241.     }
  242.     public function getFetchPartial(): ?bool
  243.     {
  244.         return $this->fetchPartial;
  245.     }
  246.     public function withFetchPartial(bool $fetchPartial): static
  247.     {
  248.         $self = clone $this;
  249.         $self->fetchPartial $fetchPartial;
  250.         return $self;
  251.     }
  252.     public function getForceEager(): ?bool
  253.     {
  254.         return $this->forceEager;
  255.     }
  256.     public function withForceEager(bool $forceEager): static
  257.     {
  258.         $self = clone $this;
  259.         $self->forceEager $forceEager;
  260.         return $self;
  261.     }
  262.     public function getPaginationEnabled(): ?bool
  263.     {
  264.         return $this->paginationEnabled;
  265.     }
  266.     public function withPaginationEnabled(bool $paginationEnabled): static
  267.     {
  268.         $self = clone $this;
  269.         $self->paginationEnabled $paginationEnabled;
  270.         return $self;
  271.     }
  272.     public function getPaginationType(): ?string
  273.     {
  274.         return $this->paginationType;
  275.     }
  276.     public function withPaginationType(string $paginationType): static
  277.     {
  278.         $self = clone $this;
  279.         $self->paginationType $paginationType;
  280.         return $self;
  281.     }
  282.     public function getPaginationItemsPerPage(): ?int
  283.     {
  284.         return $this->paginationItemsPerPage;
  285.     }
  286.     public function withPaginationItemsPerPage(int $paginationItemsPerPage): static
  287.     {
  288.         $self = clone $this;
  289.         $self->paginationItemsPerPage $paginationItemsPerPage;
  290.         return $self;
  291.     }
  292.     public function getPaginationMaximumItemsPerPage(): ?int
  293.     {
  294.         return $this->paginationMaximumItemsPerPage;
  295.     }
  296.     public function withPaginationMaximumItemsPerPage(int $paginationMaximumItemsPerPage): static
  297.     {
  298.         $self = clone $this;
  299.         $self->paginationMaximumItemsPerPage $paginationMaximumItemsPerPage;
  300.         return $self;
  301.     }
  302.     public function getPaginationPartial(): ?bool
  303.     {
  304.         return $this->paginationPartial;
  305.     }
  306.     public function withPaginationPartial(bool $paginationPartial): static
  307.     {
  308.         $self = clone $this;
  309.         $self->paginationPartial $paginationPartial;
  310.         return $self;
  311.     }
  312.     public function getPaginationClientEnabled(): ?bool
  313.     {
  314.         return $this->paginationClientEnabled;
  315.     }
  316.     public function withPaginationClientEnabled(bool $paginationClientEnabled): static
  317.     {
  318.         $self = clone $this;
  319.         $self->paginationClientEnabled $paginationClientEnabled;
  320.         return $self;
  321.     }
  322.     public function getPaginationClientItemsPerPage(): ?bool
  323.     {
  324.         return $this->paginationClientItemsPerPage;
  325.     }
  326.     public function withPaginationClientItemsPerPage(bool $paginationClientItemsPerPage): static
  327.     {
  328.         $self = clone $this;
  329.         $self->paginationClientItemsPerPage $paginationClientItemsPerPage;
  330.         return $self;
  331.     }
  332.     public function getPaginationClientPartial(): ?bool
  333.     {
  334.         return $this->paginationClientPartial;
  335.     }
  336.     public function withPaginationClientPartial(bool $paginationClientPartial): static
  337.     {
  338.         $self = clone $this;
  339.         $self->paginationClientPartial $paginationClientPartial;
  340.         return $self;
  341.     }
  342.     public function getPaginationFetchJoinCollection(): ?bool
  343.     {
  344.         return $this->paginationFetchJoinCollection;
  345.     }
  346.     public function withPaginationFetchJoinCollection(bool $paginationFetchJoinCollection): static
  347.     {
  348.         $self = clone $this;
  349.         $self->paginationFetchJoinCollection $paginationFetchJoinCollection;
  350.         return $self;
  351.     }
  352.     public function getPaginationUseOutputWalkers(): ?bool
  353.     {
  354.         return $this->paginationUseOutputWalkers;
  355.     }
  356.     public function withPaginationUseOutputWalkers(bool $paginationUseOutputWalkers): static
  357.     {
  358.         $self = clone $this;
  359.         $self->paginationUseOutputWalkers $paginationUseOutputWalkers;
  360.         return $self;
  361.     }
  362.     public function getSecurity(): ?string
  363.     {
  364.         return $this->security;
  365.     }
  366.     public function withSecurity($security): static
  367.     {
  368.         $self = clone $this;
  369.         $self->security $security;
  370.         return $self;
  371.     }
  372.     public function getSecurityMessage(): ?string
  373.     {
  374.         return $this->securityMessage;
  375.     }
  376.     public function withSecurityMessage(string $securityMessage): static
  377.     {
  378.         $self = clone $this;
  379.         $self->securityMessage $securityMessage;
  380.         return $self;
  381.     }
  382.     public function getSecurityPostDenormalize(): ?string
  383.     {
  384.         return $this->securityPostDenormalize;
  385.     }
  386.     public function withSecurityPostDenormalize($securityPostDenormalize): static
  387.     {
  388.         $self = clone $this;
  389.         $self->securityPostDenormalize $securityPostDenormalize;
  390.         return $self;
  391.     }
  392.     public function getSecurityPostDenormalizeMessage(): ?string
  393.     {
  394.         return $this->securityPostDenormalizeMessage;
  395.     }
  396.     public function withSecurityPostDenormalizeMessage(string $securityPostDenormalizeMessage): static
  397.     {
  398.         $self = clone $this;
  399.         $self->securityPostDenormalizeMessage $securityPostDenormalizeMessage;
  400.         return $self;
  401.     }
  402.     public function getSecurityPostValidation(): ?string
  403.     {
  404.         return $this->securityPostValidation;
  405.     }
  406.     public function withSecurityPostValidation(string $securityPostValidation null): static
  407.     {
  408.         $self = clone $this;
  409.         $self->securityPostValidation $securityPostValidation;
  410.         return $self;
  411.     }
  412.     public function getSecurityPostValidationMessage(): ?string
  413.     {
  414.         return $this->securityPostValidationMessage;
  415.     }
  416.     public function withSecurityPostValidationMessage(string $securityPostValidationMessage null): static
  417.     {
  418.         $self = clone $this;
  419.         $self->securityPostValidationMessage $securityPostValidationMessage;
  420.         return $self;
  421.     }
  422.     public function getProcessor(): callable|string|null
  423.     {
  424.         return $this->processor;
  425.     }
  426.     public function withProcessor(callable|string|null $processor): static
  427.     {
  428.         $self = clone $this;
  429.         $self->processor $processor;
  430.         return $self;
  431.     }
  432.     public function getProvider(): callable|string|null
  433.     {
  434.         return $this->provider;
  435.     }
  436.     public function withProvider(callable|string|null $provider): static
  437.     {
  438.         $self = clone $this;
  439.         $self->provider $provider;
  440.         return $self;
  441.     }
  442.     public function getStateOptions(): ?OptionsInterface
  443.     {
  444.         return $this->stateOptions;
  445.     }
  446.     public function withStateOptions(?OptionsInterface $stateOptions): static
  447.     {
  448.         $self = clone $this;
  449.         $self->stateOptions $stateOptions;
  450.         return $self;
  451.     }
  452.     public function getExtraProperties(): ?array
  453.     {
  454.         return $this->extraProperties;
  455.     }
  456.     public function withExtraProperties(array $extraProperties = []): static
  457.     {
  458.         $self = clone $this;
  459.         $self->extraProperties $extraProperties;
  460.         return $self;
  461.     }
  462. }