vendor/api-platform/core/src/Metadata/Operation.php line 226

  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.  * âš  This class and its children offer no backward compatibility regarding positional parameters.
  15.  */
  16. abstract class Operation
  17. {
  18.     use WithResourceTrait;
  19.     /**
  20.      * @param bool|null                           $paginationEnabled              {@see https://api-platform.com/docs/core/pagination/#for-a-specific-resource}
  21.      * @param string|null                         $paginationType                 {@see https://api-platform.com/docs/core/graphql/#using-the-page-based-pagination}
  22.      * @param int|null                            $paginationItemsPerPage         {@see https://api-platform.com/docs/core/pagination/#changing-the-number-of-items-per-page}
  23.      * @param int|null                            $paginationMaximumItemsPerPage  {@see https://api-platform.com/docs/core/pagination/#changing-maximum-items-per-page}
  24.      * @param bool|null                           $paginationPartial              {@see https://api-platform.com/docs/core/performance/#partial-pagination}
  25.      * @param bool|null                           $paginationClientEnabled        {@see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-1}
  26.      * @param bool|null                           $paginationClientItemsPerPage   {@see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-3}
  27.      * @param bool|null                           $paginationClientPartial        {@see https://api-platform.com/docs/core/pagination/#for-a-specific-resource-6}
  28.      * @param bool|null                           $paginationFetchJoinCollection  {@see https://api-platform.com/docs/core/pagination/#controlling-the-behavior-of-the-doctrine-orm-paginator}
  29.      * @param array<string, string>|string[]|null $order                          {@see https://api-platform.com/docs/core/default-order/#overriding-default-order}
  30.      * @param string|null                         $security                       {@see https://api-platform.com/docs/core/security}
  31.      * @param string|null                         $securityMessage                {@see https://api-platform.com/docs/core/security/#configuring-the-access-control-error-message}
  32.      * @param string|null                         $securityPostDenormalize        {@see https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization}
  33.      * @param string|null                         $securityPostDenormalizeMessage {@see https://api-platform.com/docs/core/security/#configuring-the-access-control-error-message}
  34.      * @param string|null                         $deprecationReason              {@see https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties}
  35.      * @param string[]|null                       $filters                        {@see https://api-platform.com/docs/core/filters/#doctrine-orm-and-mongodb-odm-filters}
  36.      * @param array{
  37.      *     class?: string|null,
  38.      *     name?: string,
  39.      * }|string|false|null $input {@see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation}
  40.      * @param array{
  41.      *     class?: string|null,
  42.      *     name?: string,
  43.      * }|string|false|null $output {@see https://api-platform.com/docs/core/dto/#specifying-an-input-or-an-output-data-representation}
  44.      * @param string|array|bool|null $mercure       {@see https://api-platform.com/docs/core/mercure}
  45.      * @param string|bool|null       $messenger     {@see https://api-platform.com/docs/core/messenger/#dispatching-a-resource-through-the-message-bus}
  46.      * @param bool|null              $elasticsearch {@see https://api-platform.com/docs/core/elasticsearch/}
  47.      * @param bool|null              $read          {@see https://api-platform.com/docs/core/events/#the-event-system}
  48.      * @param bool|null              $deserialize   {@see https://api-platform.com/docs/core/events/#the-event-system}
  49.      * @param bool|null              $validate      {@see https://api-platform.com/docs/core/events/#the-event-system}
  50.      * @param bool|null              $write         {@see https://api-platform.com/docs/core/events/#the-event-system}
  51.      * @param bool|null              $serialize     {@see https://api-platform.com/docs/core/events/#the-event-system}
  52.      * @param bool|null              $fetchPartial  {@see https://api-platform.com/docs/core/performance/#fetch-partial}
  53.      * @param bool|null              $forceEager    {@see https://api-platform.com/docs/core/performance/#force-eager}
  54.      * @param string|callable|null   $provider      {@see https://api-platform.com/docs/core/state-providers/#state-providers}
  55.      * @param string|callable|null   $processor     {@see https://api-platform.com/docs/core/state-processors/#state-processors}
  56.      */
  57.     public function __construct(
  58.         protected ?string $shortName null,
  59.         protected ?string $class null,
  60.         protected ?bool $paginationEnabled null,
  61.         protected ?string $paginationType null,
  62.         protected ?int $paginationItemsPerPage null,
  63.         protected ?int $paginationMaximumItemsPerPage null,
  64.         protected ?bool $paginationPartial null,
  65.         protected ?bool $paginationClientEnabled null,
  66.         protected ?bool $paginationClientItemsPerPage null,
  67.         protected ?bool $paginationClientPartial null,
  68.         protected ?bool $paginationFetchJoinCollection null,
  69.         protected ?bool $paginationUseOutputWalkers null,
  70.         protected ?array $order null,
  71.         protected ?string $description null,
  72.         protected ?array $normalizationContext null,
  73.         protected ?array $denormalizationContext null,
  74.         protected ?bool $collectDenormalizationErrors null,
  75.         protected ?string $security null,
  76.         protected ?string $securityMessage null,
  77.         protected ?string $securityPostDenormalize null,
  78.         protected ?string $securityPostDenormalizeMessage null,
  79.         protected ?string $securityPostValidation null,
  80.         protected ?string $securityPostValidationMessage null,
  81.         protected ?string $deprecationReason null,
  82.         protected ?array $filters null,
  83.         protected ?array $validationContext null,
  84.         protected $input null,
  85.         protected $output null,
  86.         protected $mercure null,
  87.         protected $messenger null,
  88.         protected ?bool $elasticsearch null,
  89.         protected ?int $urlGenerationStrategy null,
  90.         protected ?bool $read null,
  91.         protected ?bool $deserialize null,
  92.         protected ?bool $validate null,
  93.         protected ?bool $write null,
  94.         protected ?bool $serialize null,
  95.         protected ?bool $fetchPartial null,
  96.         protected ?bool $forceEager null,
  97.         protected ?int $priority null,
  98.         protected ?string $name null,
  99.         protected $provider null,
  100.         protected $processor null,
  101.         protected ?OptionsInterface $stateOptions null,
  102.         protected array $extraProperties = [],
  103.     ) {
  104.     }
  105.     public function withOperation($operation)
  106.     {
  107.         return $this->copyFrom($operation);
  108.     }
  109.     public function getShortName(): ?string
  110.     {
  111.         return $this->shortName;
  112.     }
  113.     public function withShortName(string $shortName null): self
  114.     {
  115.         $self = clone $this;
  116.         $self->shortName $shortName;
  117.         return $self;
  118.     }
  119.     public function getClass(): ?string
  120.     {
  121.         return $this->class;
  122.     }
  123.     public function withClass(string $class null): self
  124.     {
  125.         $self = clone $this;
  126.         $self->class $class;
  127.         return $self;
  128.     }
  129.     public function getPaginationEnabled(): ?bool
  130.     {
  131.         return $this->paginationEnabled;
  132.     }
  133.     public function withPaginationEnabled(bool $paginationEnabled null): self
  134.     {
  135.         $self = clone $this;
  136.         $self->paginationEnabled $paginationEnabled;
  137.         return $self;
  138.     }
  139.     public function getPaginationType(): ?string
  140.     {
  141.         return $this->paginationType;
  142.     }
  143.     public function withPaginationType(string $paginationType null): self
  144.     {
  145.         $self = clone $this;
  146.         $self->paginationType $paginationType;
  147.         return $self;
  148.     }
  149.     public function getPaginationItemsPerPage(): ?int
  150.     {
  151.         return $this->paginationItemsPerPage;
  152.     }
  153.     public function withPaginationItemsPerPage(int $paginationItemsPerPage null): self
  154.     {
  155.         $self = clone $this;
  156.         $self->paginationItemsPerPage $paginationItemsPerPage;
  157.         return $self;
  158.     }
  159.     public function getPaginationMaximumItemsPerPage(): ?int
  160.     {
  161.         return $this->paginationMaximumItemsPerPage;
  162.     }
  163.     public function withPaginationMaximumItemsPerPage(int $paginationMaximumItemsPerPage null): self
  164.     {
  165.         $self = clone $this;
  166.         $self->paginationMaximumItemsPerPage $paginationMaximumItemsPerPage;
  167.         return $self;
  168.     }
  169.     public function getPaginationPartial(): ?bool
  170.     {
  171.         return $this->paginationPartial;
  172.     }
  173.     public function withPaginationPartial(bool $paginationPartial null): self
  174.     {
  175.         $self = clone $this;
  176.         $self->paginationPartial $paginationPartial;
  177.         return $self;
  178.     }
  179.     public function getPaginationClientEnabled(): ?bool
  180.     {
  181.         return $this->paginationClientEnabled;
  182.     }
  183.     public function withPaginationClientEnabled(bool $paginationClientEnabled null): self
  184.     {
  185.         $self = clone $this;
  186.         $self->paginationClientEnabled $paginationClientEnabled;
  187.         return $self;
  188.     }
  189.     public function getPaginationClientItemsPerPage(): ?bool
  190.     {
  191.         return $this->paginationClientItemsPerPage;
  192.     }
  193.     public function withPaginationClientItemsPerPage(bool $paginationClientItemsPerPage null): self
  194.     {
  195.         $self = clone $this;
  196.         $self->paginationClientItemsPerPage $paginationClientItemsPerPage;
  197.         return $self;
  198.     }
  199.     public function getPaginationClientPartial(): ?bool
  200.     {
  201.         return $this->paginationClientPartial;
  202.     }
  203.     public function withPaginationClientPartial(bool $paginationClientPartial null): self
  204.     {
  205.         $self = clone $this;
  206.         $self->paginationClientPartial $paginationClientPartial;
  207.         return $self;
  208.     }
  209.     public function getPaginationFetchJoinCollection(): ?bool
  210.     {
  211.         return $this->paginationFetchJoinCollection;
  212.     }
  213.     public function withPaginationFetchJoinCollection(bool $paginationFetchJoinCollection null): self
  214.     {
  215.         $self = clone $this;
  216.         $self->paginationFetchJoinCollection $paginationFetchJoinCollection;
  217.         return $self;
  218.     }
  219.     public function getPaginationUseOutputWalkers(): ?bool
  220.     {
  221.         return $this->paginationUseOutputWalkers;
  222.     }
  223.     public function withPaginationUseOutputWalkers(bool $paginationUseOutputWalkers null): self
  224.     {
  225.         $self = clone $this;
  226.         $self->paginationUseOutputWalkers $paginationUseOutputWalkers;
  227.         return $self;
  228.     }
  229.     public function getOrder(): ?array
  230.     {
  231.         return $this->order;
  232.     }
  233.     public function withOrder(array $order = []): self
  234.     {
  235.         $self = clone $this;
  236.         $self->order $order;
  237.         return $self;
  238.     }
  239.     public function getDescription(): ?string
  240.     {
  241.         return $this->description;
  242.     }
  243.     public function withDescription(string $description null): self
  244.     {
  245.         $self = clone $this;
  246.         $self->description $description;
  247.         return $self;
  248.     }
  249.     public function getNormalizationContext(): ?array
  250.     {
  251.         return $this->normalizationContext;
  252.     }
  253.     public function withNormalizationContext(array $normalizationContext = []): self
  254.     {
  255.         $self = clone $this;
  256.         $self->normalizationContext $normalizationContext;
  257.         return $self;
  258.     }
  259.     public function getDenormalizationContext(): ?array
  260.     {
  261.         return $this->denormalizationContext;
  262.     }
  263.     public function withDenormalizationContext(array $denormalizationContext = []): self
  264.     {
  265.         $self = clone $this;
  266.         $self->denormalizationContext $denormalizationContext;
  267.         return $self;
  268.     }
  269.     public function getCollectDenormalizationErrors(): ?bool
  270.     {
  271.         return $this->collectDenormalizationErrors;
  272.     }
  273.     public function withCollectDenormalizationErrors(bool $collectDenormalizationErrors null): self
  274.     {
  275.         $self = clone $this;
  276.         $self->collectDenormalizationErrors $collectDenormalizationErrors;
  277.         return $self;
  278.     }
  279.     public function getSecurity(): ?string
  280.     {
  281.         return $this->security;
  282.     }
  283.     public function withSecurity(string $security null): self
  284.     {
  285.         $self = clone $this;
  286.         $self->security $security;
  287.         return $self;
  288.     }
  289.     public function getSecurityMessage(): ?string
  290.     {
  291.         return $this->securityMessage;
  292.     }
  293.     public function withSecurityMessage(string $securityMessage null): self
  294.     {
  295.         $self = clone $this;
  296.         $self->securityMessage $securityMessage;
  297.         return $self;
  298.     }
  299.     public function getSecurityPostDenormalize(): ?string
  300.     {
  301.         return $this->securityPostDenormalize;
  302.     }
  303.     public function withSecurityPostDenormalize(string $securityPostDenormalize null): self
  304.     {
  305.         $self = clone $this;
  306.         $self->securityPostDenormalize $securityPostDenormalize;
  307.         return $self;
  308.     }
  309.     public function getSecurityPostDenormalizeMessage(): ?string
  310.     {
  311.         return $this->securityPostDenormalizeMessage;
  312.     }
  313.     public function withSecurityPostDenormalizeMessage(string $securityPostDenormalizeMessage null): self
  314.     {
  315.         $self = clone $this;
  316.         $self->securityPostDenormalizeMessage $securityPostDenormalizeMessage;
  317.         return $self;
  318.     }
  319.     public function getSecurityPostValidation(): ?string
  320.     {
  321.         return $this->securityPostValidation;
  322.     }
  323.     public function withSecurityPostValidation(string $securityPostValidation null): self
  324.     {
  325.         $self = clone $this;
  326.         $self->securityPostValidation $securityPostValidation;
  327.         return $self;
  328.     }
  329.     public function getSecurityPostValidationMessage(): ?string
  330.     {
  331.         return $this->securityPostValidationMessage;
  332.     }
  333.     public function withSecurityPostValidationMessage(string $securityPostValidationMessage null): self
  334.     {
  335.         $self = clone $this;
  336.         $self->securityPostValidationMessage $securityPostValidationMessage;
  337.         return $self;
  338.     }
  339.     public function getDeprecationReason(): ?string
  340.     {
  341.         return $this->deprecationReason;
  342.     }
  343.     public function withDeprecationReason(string $deprecationReason null): self
  344.     {
  345.         $self = clone $this;
  346.         $self->deprecationReason $deprecationReason;
  347.         return $self;
  348.     }
  349.     public function getFilters(): ?array
  350.     {
  351.         return $this->filters;
  352.     }
  353.     public function withFilters(array $filters = []): self
  354.     {
  355.         $self = clone $this;
  356.         $self->filters $filters;
  357.         return $self;
  358.     }
  359.     public function getValidationContext(): ?array
  360.     {
  361.         return $this->validationContext;
  362.     }
  363.     public function withValidationContext(array $validationContext = []): self
  364.     {
  365.         $self = clone $this;
  366.         $self->validationContext $validationContext;
  367.         return $self;
  368.     }
  369.     public function getInput()
  370.     {
  371.         return $this->input;
  372.     }
  373.     public function withInput($input null): self
  374.     {
  375.         $self = clone $this;
  376.         $self->input $input;
  377.         return $self;
  378.     }
  379.     public function getOutput()
  380.     {
  381.         return $this->output;
  382.     }
  383.     public function withOutput($output null): self
  384.     {
  385.         $self = clone $this;
  386.         $self->output $output;
  387.         return $self;
  388.     }
  389.     public function getMercure()
  390.     {
  391.         return $this->mercure;
  392.     }
  393.     public function withMercure($mercure null): self
  394.     {
  395.         $self = clone $this;
  396.         $self->mercure $mercure;
  397.         return $self;
  398.     }
  399.     public function getMessenger()
  400.     {
  401.         return $this->messenger;
  402.     }
  403.     public function withMessenger($messenger null): self
  404.     {
  405.         $self = clone $this;
  406.         $self->messenger $messenger;
  407.         return $self;
  408.     }
  409.     public function getElasticsearch(): ?bool
  410.     {
  411.         return $this->elasticsearch;
  412.     }
  413.     public function withElasticsearch(bool $elasticsearch null): self
  414.     {
  415.         $self = clone $this;
  416.         $self->elasticsearch $elasticsearch;
  417.         return $self;
  418.     }
  419.     public function getUrlGenerationStrategy(): ?int
  420.     {
  421.         return $this->urlGenerationStrategy;
  422.     }
  423.     public function withUrlGenerationStrategy(int $urlGenerationStrategy null): self
  424.     {
  425.         $self = clone $this;
  426.         $self->urlGenerationStrategy $urlGenerationStrategy;
  427.         return $self;
  428.     }
  429.     public function canRead(): ?bool
  430.     {
  431.         return $this->read;
  432.     }
  433.     public function withRead(bool $read true): self
  434.     {
  435.         $self = clone $this;
  436.         $self->read $read;
  437.         return $self;
  438.     }
  439.     public function canDeserialize(): ?bool
  440.     {
  441.         return $this->deserialize;
  442.     }
  443.     public function withDeserialize(bool $deserialize true): self
  444.     {
  445.         $self = clone $this;
  446.         $self->deserialize $deserialize;
  447.         return $self;
  448.     }
  449.     public function canValidate(): ?bool
  450.     {
  451.         return $this->validate;
  452.     }
  453.     public function withValidate(bool $validate true): self
  454.     {
  455.         $self = clone $this;
  456.         $self->validate $validate;
  457.         return $self;
  458.     }
  459.     public function canWrite(): ?bool
  460.     {
  461.         return $this->write;
  462.     }
  463.     public function withWrite(bool $write true): self
  464.     {
  465.         $self = clone $this;
  466.         $self->write $write;
  467.         return $self;
  468.     }
  469.     public function canSerialize(): ?bool
  470.     {
  471.         return $this->serialize;
  472.     }
  473.     public function withSerialize(bool $serialize true): self
  474.     {
  475.         $self = clone $this;
  476.         $self->serialize $serialize;
  477.         return $self;
  478.     }
  479.     public function getFetchPartial(): ?bool
  480.     {
  481.         return $this->fetchPartial;
  482.     }
  483.     public function withFetchPartial(bool $fetchPartial null): self
  484.     {
  485.         $self = clone $this;
  486.         $self->fetchPartial $fetchPartial;
  487.         return $self;
  488.     }
  489.     public function getForceEager(): ?bool
  490.     {
  491.         return $this->forceEager;
  492.     }
  493.     public function withForceEager(bool $forceEager null): self
  494.     {
  495.         $self = clone $this;
  496.         $self->forceEager $forceEager;
  497.         return $self;
  498.     }
  499.     public function getPriority(): ?int
  500.     {
  501.         return $this->priority;
  502.     }
  503.     public function withPriority(int $priority 0): self
  504.     {
  505.         $self = clone $this;
  506.         $self->priority $priority;
  507.         return $self;
  508.     }
  509.     public function getName(): ?string
  510.     {
  511.         return $this->name;
  512.     }
  513.     public function withName(string $name ''): self
  514.     {
  515.         $self = clone $this;
  516.         $self->name $name;
  517.         return $self;
  518.     }
  519.     public function getProcessor(): callable|string|null
  520.     {
  521.         return $this->processor;
  522.     }
  523.     public function withProcessor(callable|string|null $processor): self
  524.     {
  525.         $self = clone $this;
  526.         $self->processor $processor;
  527.         return $self;
  528.     }
  529.     public function getProvider(): callable|string|null
  530.     {
  531.         return $this->provider;
  532.     }
  533.     public function withProvider(callable|string|null $provider): self
  534.     {
  535.         $self = clone $this;
  536.         $self->provider $provider;
  537.         return $self;
  538.     }
  539.     public function getExtraProperties(): array
  540.     {
  541.         return $this->extraProperties;
  542.     }
  543.     public function withExtraProperties(array $extraProperties = []): self
  544.     {
  545.         $self = clone $this;
  546.         $self->extraProperties $extraProperties;
  547.         return $self;
  548.     }
  549.     public function getStateOptions(): ?OptionsInterface
  550.     {
  551.         return $this->stateOptions;
  552.     }
  553.     public function withStateOptions(?OptionsInterface $stateOptions): self
  554.     {
  555.         $self = clone $this;
  556.         $self->stateOptions $stateOptions;
  557.         return $self;
  558.     }
  559. }