vendor/api-platform/core/src/Metadata/ApiResource.php line 32

  1. <?php
  2. /*
  3.  * This file is part of the API Platform project.
  4.  *
  5.  * (c) Kévin Dunglas <[email protected]>
  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\Metadata\GraphQl\Operation as GraphQlOperation;
  13. use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
  14. use ApiPlatform\State\OptionsInterface;
  15. /**
  16.  * Resource metadata attribute.
  17.  *
  18.  * The API Resource attribute declares the behaviors attached to a Resource inside API Platform.
  19.  * This class is immutable, and if you set a value yourself, API Platform will not override the value.
  20.  * The API Resource helps sharing options with operations.
  21.  *
  22.  * Read more about how metadata works [here](/docs/in-depth/metadata).
  23.  *
  24.  * @author Antoine Bluchet <[email protected]>
  25.  */
  26. #[\Attribute(\Attribute::TARGET_CLASS \Attribute::IS_REPEATABLE)]
  27. class ApiResource
  28. {
  29.     use WithResourceTrait;
  30.     protected ?Operations $operations;
  31.     /**
  32.      * @var string|callable|null
  33.      */
  34.     protected $provider;
  35.     /**
  36.      * @var string|callable|null
  37.      */
  38.     protected $processor;
  39.     /**
  40.      * @param array<int, HttpOperation>|array<string, HttpOperation>|Operations|null $operations   Operations is a list of HttpOperation
  41.      * @param array<string, Link>|array<string, mixed[]>|string[]|string|null        $uriVariables
  42.      * @param string|callable|null                                                   $provider
  43.      * @param string|callable|null                                                   $processor
  44.      * @param mixed|null                                                             $mercure
  45.      * @param mixed|null                                                             $messenger
  46.      * @param mixed|null                                                             $input
  47.      * @param mixed|null                                                             $output
  48.      */
  49.     public function __construct(
  50.         /**
  51.          * The URI template represents your resource IRI with optional variables. It follows [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.html).
  52.          * API Platform generates this URL for you if you leave this empty.
  53.          */
  54.         protected ?string $uriTemplate null,
  55.         /**
  56.          * The short name of your resource is a unique name that identifies your resource.
  57.          * It is used within the documentation and for url generation if the `uriTemplate` is not filled. By default, this will be the name of your PHP class.
  58.          */
  59.         protected ?string $shortName null,
  60.         /**
  61.          * A description for this resource that will show on documentations.
  62.          */
  63.         protected ?string $description null,
  64.         /**
  65.          * The RDF types of this resource.
  66.          * An RDF type is usually a URI referencing how your resource is structured for the outside world. Values can be a string `https://schema.org/Book`
  67.          * or an array of string `['https://schema.org/Flight', 'https://schema.org/BusTrip']`.
  68.          */
  69.         protected string|array|null $types null,
  70.         /**
  71.          * Operations is a list of [HttpOperation](./HttpOperation).
  72.          *
  73.          * By default API Platform declares operations representing CRUD routes if you don't specify this parameter:
  74.          *
  75.          * ```php
  76.          * #[ApiResource(
  77.          *     operations: [
  78.          *         new Get(uriTemplate: '/books/{id}'),
  79.          *         // The GetCollection operation returns a list of Books.
  80.          *         new GetCollection(uriTemplate: '/books'),
  81.          *         new Post(uriTemplate: '/books'),
  82.          *         new Patch(uriTemplate: '/books/{id}'),
  83.          *         new Delete(uriTemplate: '/books/{id}'),
  84.          *     ]
  85.          * )]
  86.          *
  87.          * ```
  88.          *
  89.          * Try this live at [play.api-platform.com/api-resource](play.api-platform.com).
  90.          */
  91.         $operations null,
  92.         /**
  93.          * The `formats` option allows you to customize content negotiation. By default API Platform supports JsonLd, Hal, JsonAPI.
  94.          * For other formats we use the Symfony Serializer.
  95.          *
  96.          * ```php
  97.          * #[ApiResource(
  98.          *   formats: [
  99.          *       'jsonld' => ['application/ld+json'],
  100.          *       'jsonhal' => ['application/hal+json'],
  101.          *       'jsonapi' => ['application/vnd.api+json'],
  102.          *       'json' =>    ['application/json'],
  103.          *       'xml' =>     ['application/xml', 'text/xml'],
  104.          *       'yaml' =>    ['application/x-yaml'],
  105.          *       'csv' =>     ['text/csv'],
  106.          *       'html' =>    ['text/html'],
  107.          *       'myformat' =>['application/vnd.myformat'],
  108.          *   ]
  109.          * )]
  110.          * ```
  111.          *
  112.          * Learn more about custom formats in the [dedicated guide](/guides/custom-formats).
  113.          */
  114.         protected array|string|null $formats null,
  115.         /**
  116.          * The `inputFormats` option allows you to customize content negotiation for HTTP bodies:.
  117.          *
  118.          * ```php
  119.          *  #[ApiResource(formats: ['jsonld', 'csv' => ['text/csv']], operations: [
  120.          *      new Patch(inputFormats: ['json' => ['application/merge-patch+json']]),
  121.          *      new GetCollection(),
  122.          *      new Post(),
  123.          *  ])]
  124.          * ```
  125.          */
  126.         protected array|string|null $inputFormats null,
  127.         /**
  128.          * The `outputFormats` option allows you to customize content negotiation for HTTP responses.
  129.          */
  130.         protected array|string|null $outputFormats null,
  131.         /**
  132.          * The `uriVariables` configuration allows to configure to what each URI Variable.
  133.          * With [simple string expansion](https://www.rfc-editor.org/rfc/rfc6570.html#section-3.2.2), we read the input
  134.          * value and match this to the given `Link`. Note that this setting is usually used on an operation directly:.
  135.          *
  136.          * ```php
  137.          *   #[ApiResource(
  138.          *       uriTemplate: '/companies/{companyId}/employees/{id}',
  139.          *       uriVariables: [
  140.          *           'companyId' => new Link(fromClass: Company::class, toProperty: 'company']),
  141.          *           'id' => new Link(fromClass: Employee::class)
  142.          *       ],
  143.          *       operations: [new Get()]
  144.          *   )]
  145.          * ```
  146.          *
  147.          * For more examples, read our guide on [subresources](/guides/subresources).
  148.          */
  149.         protected $uriVariables null,
  150.         /**
  151.          * The `routePrefix` allows you to configure a prefix that will apply to this resource.
  152.          *
  153.          * ```php
  154.          *   #[ApiResource(
  155.          *       routePrefix: '/books',
  156.          *       operations: [new Get(uriTemplate: '/{id}')]
  157.          *   )]
  158.          * ```
  159.          *
  160.          * This resource will be accessible through `/books/{id}`.
  161.          */
  162.         protected ?string $routePrefix null,
  163.         /**
  164.          * The `defaults` option adds up to [Symfony's route defaults](https://github.com/symfony/routing/blob/8f068b792e515b25e26855ac8dc7fe800399f3e5/Route.php#L41). You can override [API Platform's defaults](https://github.com/api-platform/core/blob/6abd0fe0a69d4842eb6d5c31ef2bd6dce0e1d372/src/Symfony/Routing/ApiLoader.php#L87) if needed.
  165.          */
  166.         protected ?array $defaults null,
  167.         /**
  168.          * The `requirements` option configures the Symfony's Route requirements.
  169.          */
  170.         protected ?array $requirements null,
  171.         /**
  172.          * The `options` option configures the Symfony's Route options.
  173.          */
  174.         protected ?array $options null,
  175.         /**
  176.          * The `stateless` option configures the Symfony's Route stateless option.
  177.          */
  178.         protected ?bool $stateless null,
  179.         /**
  180.          * The `sunset` option indicates when a deprecated operation will be removed.
  181.          *
  182.          * <CodeSelector>
  183.          *
  184.          * ```php
  185.          * <?php
  186.          * // api/src/Entity/Parchment.php
  187.          * use ApiPlatform\Metadata\ApiResource;
  188.          *
  189.          * #[ApiResource(deprecationReason: 'Create a Book instead', sunset: '01/01/2020')]
  190.          * class Parchment
  191.          * {
  192.          *     // ...
  193.          * }
  194.          * ```
  195.          *
  196.          * ```yaml
  197.          * # api/config/api_platform/resources.yaml
  198.          * resources:
  199.          *     App\Entity\Parchment:
  200.          *         - deprecationReason: 'Create a Book instead'
  201.          *           sunset: '01/01/2020'
  202.          * ```
  203.          *
  204.          * ```xml
  205.          * <?xml version="1.0" encoding="UTF-8" ?>
  206.          * <!-- api/config/api_platform/resources.xml -->
  207.          *
  208.          * <resources
  209.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  210.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  211.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  212.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  213.          *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" sunset="01/01/2020" />
  214.          * </resources>
  215.          * ```
  216.          *
  217.          * </CodeSelector>
  218.          */
  219.         protected ?string $sunset null,
  220.         protected ?string $acceptPatch null,
  221.         protected ?int $status null,
  222.         protected ?string $host null,
  223.         protected ?array $schemes null,
  224.         protected ?string $condition null,
  225.         protected ?string $controller null,
  226.         protected ?string $class null,
  227.         /**
  228.          * The `urlGenerationStrategy` option configures the url generation strategy.
  229.          *
  230.          * See: [UrlGeneratorInterface::class](/reference/Api/UrlGeneratorInterface)
  231.          *
  232.          * <CodeSelector>
  233.          * ```php
  234.          * <?php
  235.          * // api/src/Entity/Book.php
  236.          * use ApiPlatform\Metadata\ApiResource;
  237.          * use ApiPlatform\Api\UrlGeneratorInterface;
  238.          *
  239.          * #[ApiResource(urlGenerationStrategy: UrlGeneratorInterface::ABS_URL)]
  240.          * class Book
  241.          * {
  242.          *     // ...
  243.          * }
  244.          * ```
  245.          *
  246.          * ```yaml
  247.          * # api/config/api_platform/resources.yaml
  248.          * App\Entity\Book:
  249.          *     urlGenerationStrategy: !php/const ApiPlatform\Api\UrlGeneratorInterface::ABS_URL
  250.          * ```
  251.          *
  252.          * ```xml
  253.          * <?xml version="1.0" encoding="UTF-8" ?>
  254.          * <!-- api/config/api_platform/resources.xml -->
  255.          *
  256.          * <resources
  257.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  258.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  259.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  260.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  261.          *     <resource class="App\Entity\Book" urlGenerationStrategy="0" />
  262.          * </resources>
  263.          * ```
  264.          * </CodeSelector>
  265.          */
  266.         protected ?int $urlGenerationStrategy null,
  267.         /**
  268.          * The `deprecationReason` option deprecates the current resource with a deprecation message.
  269.          *
  270.          * <CodeSelector>
  271.          * ```php
  272.          * <?php
  273.          * // api/src/Entity/Parchment.php
  274.          * use ApiPlatform\Metadata\ApiResource;
  275.          *
  276.          * #[ApiResource(deprecationReason: 'Create a Book instead')]
  277.          * class Parchment
  278.          * {
  279.          *     // ...
  280.          * }
  281.          * ```
  282.          *
  283.          * ```yaml
  284.          * # api/config/api_platform/resources.yaml
  285.          * resources:
  286.          *     App\Entity\Parchment:
  287.          *         - deprecationReason: 'Create a Book instead'
  288.          * ```
  289.          *
  290.          * ```xml
  291.          * <?xml version="1.0" encoding="UTF-8" ?>
  292.          * <!-- api/config/api_platform/resources.xml -->
  293.          *
  294.          * <resources
  295.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  296.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  297.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  298.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  299.          *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" />
  300.          * </resources>
  301.          * ```
  302.          * </CodeSelector>
  303.          *
  304.          * - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
  305.          * - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
  306.          * - With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema
  307.          */
  308.         protected ?string $deprecationReason null,
  309.         protected ?array $cacheHeaders null,
  310.         protected ?array $normalizationContext null,
  311.         protected ?array $denormalizationContext null,
  312.         protected ?bool $collectDenormalizationErrors null,
  313.         protected ?array $hydraContext null,
  314.         protected ?array $openapiContext null// TODO Remove in 4.0
  315.         protected bool|OpenApiOperation|null $openapi null,
  316.         /**
  317.          * The `validationContext` option configures the context of validation for the current ApiResource.
  318.          * You can, for instance, describe the validation groups that will be used:.
  319.          *
  320.          * ```php
  321.          * #[ApiResource(validationContext: ['groups' => ['a', 'b']])]
  322.          * ```
  323.          *
  324.          * For more examples, read our guide on [validation](/guides/validation).
  325.          */
  326.         protected ?array $validationContext null,
  327.         /**
  328.          * The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
  329.          *
  330.          * <CodeSelector>
  331.          * ```php
  332.          * <?php
  333.          * // api/src/Entity/Book.php
  334.          * use ApiPlatform\Metadata\ApiResource;
  335.          *
  336.          * #[ApiResource(filters: ['app.filters.book.search'])]
  337.          * class Book
  338.          * {
  339.          *     // ...
  340.          * }
  341.          * ```
  342.          *
  343.          * ```yaml
  344.          * # api/config/api_platform/resources.yaml
  345.          * resources:
  346.          *     App\Entity\Book:
  347.          *         - filters: ['app.filters.book.search']
  348.          * ```
  349.          *
  350.          * ```xml
  351.          * <?xml version="1.0" encoding="UTF-8" ?>
  352.          * <!-- api/config/api_platform/resources.xml -->
  353.          * <resources
  354.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  355.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  356.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  357.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  358.          *     <resource class="App\Entity\Book">
  359.          *         <filters>
  360.          *             <filter>app.filters.book.search</filter>
  361.          *         </filters>
  362.          *     </resource>
  363.          * </resources>
  364.          * ```
  365.          * </CodeSelector>
  366.          */
  367.         protected ?array $filters null,
  368.         protected ?bool $elasticsearch null,
  369.         protected $mercure null,
  370.         /**
  371.          * The `messenger` option dispatches the current resource through the Message Bus.
  372.          *
  373.          * <CodeSelector>
  374.          * ```php
  375.          * <?php
  376.          * // api/src/Entity/Book.php
  377.          * use ApiPlatform\Metadata\ApiResource;
  378.          *
  379.          * #[ApiResource(messenger: true)]
  380.          * class Book
  381.          * {
  382.          *     // ...
  383.          * }
  384.          * ```
  385.          *
  386.          * ```yaml
  387.          * # api/config/api_platform/resources.yaml
  388.          * resources:
  389.          *     App\Entity\Book:
  390.          *         - messenger: true
  391.          * ```
  392.          *
  393.          * ```xml
  394.          * <?xml version="1.0" encoding="UTF-8" ?>
  395.          * <!-- api/config/api_platform/resources.xml -->
  396.          *
  397.          * <resources
  398.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  399.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  400.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  401.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  402.          *     <resource class="App\Entity\Book" messenger=true />
  403.          * </resources>
  404.          * ```
  405.          * </CodeSelector>
  406.          *
  407.          * Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
  408.          * to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
  409.          * and implement your own logic.
  410.          *
  411.          * Read [how to use Messenger with an Input object](/docs/guide/using-messenger-with-an-input-object).
  412.          *
  413.          * @var string|bool|null
  414.          */
  415.         protected $messenger null,
  416.         protected $input null,
  417.         protected $output null,
  418.         /**
  419.          * Override the default order of items in your collection. Note that this is handled by our doctrine filters such as
  420.          * the [OrderFilter](/docs/reference/Doctrine/Orm/Filter/OrderFilter).
  421.          *
  422.          * By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
  423.          * customize this order, you must add an `order` attribute on your ApiResource annotation:
  424.          *
  425.          * <CodeSelector>
  426.          *
  427.          * ```php
  428.          * <?php
  429.          * // api/src/Entity/Book.php
  430.          * namespace App\Entity;
  431.          *
  432.          * use ApiPlatform\Metadata\ApiResource;
  433.          *
  434.          * #[ApiResource(order: ['foo' => 'ASC'])]
  435.          * class Book
  436.          * {
  437.          * }
  438.          * ```
  439.          *
  440.          * ```yaml
  441.          * # api/config/api_platform/resources/Book.yaml
  442.          * App\Entity\Book:
  443.          *     order:
  444.          *         foo: ASC
  445.          * ```
  446.          *
  447.          * </CodeSelector>
  448.          *
  449.          * This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
  450.          * If you only specify the key, `ASC` direction will be used as default.
  451.          */
  452.         protected ?array $order null,
  453.         protected ?bool $fetchPartial null,
  454.         protected ?bool $forceEager null,
  455.         /**
  456.          * The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
  457.          *
  458.          * <CodeSelector>
  459.          * ```php
  460.          * <?php
  461.          * // api/src/Entity/Book.php
  462.          * use ApiPlatform\Metadata\ApiResource;
  463.          *
  464.          * #[ApiResource(paginationClientEnabled: true)]
  465.          * class Book
  466.          * {
  467.          *     // ...
  468.          * }
  469.          * ```
  470.          *
  471.          * ```yaml
  472.          * # api/config/api_platform/resources.yaml
  473.          * resources:
  474.          *     App\Entity\Book:
  475.          *         - paginationClientEnabled: true
  476.          * ```
  477.          *
  478.          * ```xml
  479.          * <?xml version="1.0" encoding="UTF-8" ?>
  480.          * <!-- api/config/api_platform/resources.xml -->
  481.          *
  482.          * <resources
  483.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  484.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  485.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  486.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  487.          *     <resource class="App\Entity\Book" paginationClientEnabled=true />
  488.          * </resources>
  489.          * ```
  490.          * </CodeSelector>
  491.          *
  492.          * The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
  493.          * - `GET /books?pagination=false`: disabled
  494.          * - `GET /books?pagination=true`: enabled
  495.          */
  496.         protected ?bool $paginationClientEnabled null,
  497.         /**
  498.          * The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
  499.          *
  500.          * <CodeSelector>
  501.          * ```php
  502.          * <?php
  503.          * // api/src/Entity/Book.php
  504.          * use ApiPlatform\Metadata\ApiResource;
  505.          *
  506.          * #[ApiResource(paginationClientItemsPerPage: true)]
  507.          * class Book
  508.          * {
  509.          *     // ...
  510.          * }
  511.          * ```
  512.          *
  513.          * ```yaml
  514.          * # api/config/api_platform/resources.yaml
  515.          * resources:
  516.          *     App\Entity\Book:
  517.          *         - paginationClientItemsPerPage: true
  518.          * ```
  519.          *
  520.          * ```xml
  521.          * <?xml version="1.0" encoding="UTF-8" ?>
  522.          * <!-- api/config/api_platform/resources.xml -->
  523.          *
  524.          * <resources
  525.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  526.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  527.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  528.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  529.          *     <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
  530.          * </resources>
  531.          * ```
  532.          * </CodeSelector>
  533.          *
  534.          * The number of items can now be set by adding a query parameter named `itemsPerPage`:
  535.          * - `GET /books?itemsPerPage=50`
  536.          */
  537.         protected ?bool $paginationClientItemsPerPage null,
  538.         /**
  539.          * The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
  540.          *
  541.          * <CodeSelector>
  542.          *
  543.          * ```php
  544.          * <?php
  545.          * // api/src/Entity/Book.php
  546.          * use ApiPlatform\Metadata\ApiResource;
  547.          *
  548.          * #[ApiResource(paginationClientPartial: true)]
  549.          * class Book
  550.          * {
  551.          *     // ...
  552.          * }
  553.          * ```
  554.          *
  555.          * ```yaml
  556.          * # api/config/api_platform/resources.yaml
  557.          * resources:
  558.          *     App\Entity\Book:
  559.          *         - paginationClientPartial: true
  560.          * ```
  561.          *
  562.          * ```xml
  563.          * <?xml version="1.0" encoding="UTF-8" ?>
  564.          * <!-- api/config/api_platform/resources.xml -->
  565.          *
  566.          * <resources
  567.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  568.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  569.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  570.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  571.          *     <resource class="App\Entity\Book" paginationClientPartial=true />
  572.          * </resources>
  573.          * ```
  574.          * </CodeSelector>
  575.          *
  576.          * The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
  577.          * - `GET /books?partial=false`: disabled
  578.          * - `GET /books?partial=true`: enabled
  579.          */
  580.         protected ?bool $paginationClientPartial null,
  581.         /**
  582.          * The `paginationViaCursor` option configures the cursor-based pagination for the current resource.
  583.          * Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
  584.          * Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
  585.          *
  586.          * <CodeSelector>
  587.          * ```php
  588.          * <?php
  589.          * // api/src/Entity/Book.php
  590.          * use ApiPlatform\Metadata\ApiFilter;
  591.          * use ApiPlatform\Metadata\ApiResource;
  592.          * use ApiPlatform\Doctrine\Odm\Filter\OrderFilter;
  593.          * use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
  594.          *
  595.          * #[ApiResource(paginationPartial: true, paginationViaCursor: [['field' => 'id', 'direction' => 'DESC']])]
  596.          * #[ApiFilter(RangeFilter::class, properties: ["id"])]
  597.          * #[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])]
  598.          * class Book
  599.          * {
  600.          *     // ...
  601.          * }
  602.          * ```
  603.          *
  604.          * ```yaml
  605.          * # api/config/api_platform/resources.yaml
  606.          * resources:
  607.          *     App\Entity\Book:
  608.          *         - paginationPartial: true
  609.          *           paginationViaCursor:
  610.          *               - { field: 'id', direction: 'DESC' }
  611.          *           filters: [ 'app.filters.book.range', 'app.filters.book.order' ]
  612.          * ```
  613.          *
  614.          * ```xml
  615.          * <?xml version="1.0" encoding="UTF-8" ?>
  616.          * <!-- api/config/api_platform/resources.xml -->
  617.          *
  618.          * <resources
  619.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  620.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  621.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  622.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  623.          *     <resource class="App\Entity\Book" paginationPartial=true>
  624.          *         <filters>
  625.          *             <filter>app.filters.book.range</filter>
  626.          *             <filter>app.filters.book.order</filter>
  627.          *         </filters>
  628.          *         <paginationViaCursor>
  629.          *             <paginationField field="id" direction="DESC" />
  630.          *         </paginationViaCursor>
  631.          *     </resource>
  632.          * </resources>
  633.          * ```
  634.          * </CodeSelector>
  635.          *
  636.          * To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
  637.          */
  638.         protected ?array $paginationViaCursor null,
  639.         /**
  640.          * The `paginationEnabled` option enables (or disables) the pagination for the current resource.
  641.          *
  642.          * <CodeSelector>
  643.          * ```php
  644.          * <?php
  645.          * // api/src/Entity/Book.php
  646.          * use ApiPlatform\Metadata\ApiResource;
  647.          *
  648.          * #[ApiResource(paginationEnabled: true)]
  649.          * class Book
  650.          * {
  651.          *     // ...
  652.          * }
  653.          * ```
  654.          *
  655.          * ```yaml
  656.          * # api/config/api_platform/resources.yaml
  657.          * resources:
  658.          *     App\Entity\Book:
  659.          *         - paginationEnabled: true
  660.          * ```
  661.          *
  662.          * ```xml
  663.          * <?xml version="1.0" encoding="UTF-8" ?>
  664.          * <!-- api/config/api_platform/resources.xml -->
  665.          *
  666.          * <resources
  667.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  668.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  669.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  670.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  671.          *     <resource class="App\Entity\Book" paginationEnabled=true />
  672.          * </resources>
  673.          * ```
  674.          * </CodeSelector>
  675.          */
  676.         protected ?bool $paginationEnabled null,
  677.         /**
  678.          * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
  679.          * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$fetchJoinCollection`
  680.          * argument, whether there is a join to a collection-valued association.
  681.          *
  682.          * When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
  683.          * correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
  684.          *
  685.          * <CodeSelector>
  686.          * ```php
  687.          * <?php
  688.          * // api/src/Entity/Book.php
  689.          * use ApiPlatform\Metadata\ApiResource;
  690.          *
  691.          * #[ApiResource(paginationFetchJoinCollection: false)]
  692.          * class Book
  693.          * {
  694.          *     // ...
  695.          * }
  696.          * ```
  697.          *
  698.          * ```yaml
  699.          * # api/config/api_platform/resources.yaml
  700.          * resources:
  701.          *     App\Entity\Book:
  702.          *         - paginationFetchJoinCollection: false
  703.          * ```
  704.          *
  705.          * ```xml
  706.          * <?xml version="1.0" encoding="UTF-8" ?>
  707.          * <!-- api/config/api_platform/resources.xml -->
  708.          *
  709.          * <resources
  710.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  711.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  712.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  713.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  714.          *     <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
  715.          * </resources>
  716.          * ```
  717.          * </CodeSelector>
  718.          *
  719.          * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
  720.          */
  721.         protected ?bool $paginationFetchJoinCollection null,
  722.         /**
  723.          * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
  724.          * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$setUseOutputWalkers` setter,
  725.          * whether to use output walkers.
  726.          *
  727.          * When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
  728.          * of queries. You can configure this using the `paginationUseOutputWalkers` option:
  729.          *
  730.          * <CodeSelector>
  731.          * ```php
  732.          * <?php
  733.          * // api/src/Entity/Book.php
  734.          * use ApiPlatform\Metadata\ApiResource;
  735.          *
  736.          * #[ApiResource(paginationUseOutputWalkers: false)]
  737.          * class Book
  738.          * {
  739.          *     // ...
  740.          * }
  741.          * ```
  742.          *
  743.          * ```yaml
  744.          * # api/config/api_platform/resources.yaml
  745.          * resources:
  746.          *     App\Entity\Book:
  747.          *         - paginationUseOutputWalkers: false
  748.          * ```
  749.          *
  750.          * ```xml
  751.          * <?xml version="1.0" encoding="UTF-8" ?>
  752.          * <!-- api/config/api_platform/resources.xml -->
  753.          * <resources
  754.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  755.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  756.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  757.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  758.          *     <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
  759.          * </resources>
  760.          * ```
  761.          * </CodeSelector>
  762.          *
  763.          * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
  764.          */
  765.         protected ?bool $paginationUseOutputWalkers null,
  766.         /**
  767.          * The `paginationItemsPerPage` option defines the number of items per page for the current resource.
  768.          *
  769.          * <CodeSelector>
  770.          * ```php
  771.          * <?php
  772.          * // api/src/Entity/Book.php
  773.          * use ApiPlatform\Metadata\ApiResource;
  774.          *
  775.          * #[ApiResource(paginationItemsPerPage: 30)]
  776.          * class Book
  777.          * {
  778.          *     // ...
  779.          * }
  780.          * ```
  781.          *
  782.          * ```yaml
  783.          * # api/config/api_platform/resources.yaml
  784.          * resources:
  785.          *     App\Entity\Book:
  786.          *         - paginationItemsPerPage: 30
  787.          * ```
  788.          *
  789.          * ```xml
  790.          * <?xml version="1.0" encoding="UTF-8" ?>
  791.          * <!-- api/config/api_platform/resources.xml -->
  792.          * <resources
  793.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  794.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  795.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  796.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  797.          *     <resource class="App\Entity\Book" paginationItemsPerPage=30 />
  798.          * </resources>
  799.          * ```
  800.          * </CodeSelector>
  801.          */
  802.         protected ?int $paginationItemsPerPage null,
  803.         /**
  804.          * The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
  805.          *
  806.          * <CodeSelector>
  807.          * ```php
  808.          * <?php
  809.          * // api/src/Entity/Book.php
  810.          * use ApiPlatform\Metadata\ApiResource;
  811.          *
  812.          * #[ApiResource(paginationMaximumItemsPerPage: 50)]
  813.          * class Book
  814.          * {
  815.          *     // ...
  816.          * }
  817.          * ```
  818.          *
  819.          * ```yaml
  820.          * # api/config/api_platform/resources.yaml
  821.          * resources:
  822.          *     App\Entity\Book:
  823.          *         - paginationMaximumItemsPerPage: 50
  824.          * ```
  825.          *
  826.          * ```xml
  827.          * <?xml version="1.0" encoding="UTF-8" ?>
  828.          * <!-- api/config/api_platform/resources.xml -->
  829.          * <resources
  830.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  831.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  832.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  833.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  834.          *     <resource class="App\Entity\Book" paginationMaximumItemsPerPage=50 />
  835.          * </resources>
  836.          * ```
  837.          *
  838.          * </CodeSelector>
  839.          */
  840.         protected ?int $paginationMaximumItemsPerPage null,
  841.         /**
  842.          * The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
  843.          *
  844.          * <CodeSelector>
  845.          * ```php
  846.          * <?php
  847.          * // api/src/Entity/Book.php
  848.          * use ApiPlatform\Metadata\ApiResource;
  849.          *
  850.          * #[ApiResource(paginationPartial: true)]
  851.          * class Book
  852.          * {
  853.          *     // ...
  854.          * }
  855.          * ```
  856.          *
  857.          * ```yaml
  858.          * # api/config/api_platform/resources.yaml
  859.          * resources:
  860.          *     App\Entity\Book:
  861.          *         - paginationPartial: true
  862.          * ```
  863.          *
  864.          * ```xml
  865.          * <?xml version="1.0" encoding="UTF-8" ?>
  866.          * <!-- api/config/api_platform/resources.xml -->
  867.          * <resources
  868.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  869.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  870.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  871.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  872.          *     <resource class="App\Entity\Book" paginationPartial=true />
  873.          * </resources>
  874.          * ```
  875.          * </CodeSelector>
  876.          */
  877.         protected ?bool $paginationPartial null,
  878.         /**
  879.          * The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
  880.          *
  881.          * <CodeSelector>
  882.          * ```php
  883.          * <?php
  884.          * // api/src/Entity/Book.php
  885.          * use ApiPlatform\Metadata\ApiResource;
  886.          *
  887.          * #[ApiResource(paginationType: 'page')]
  888.          * class Book
  889.          * {
  890.          *     // ...
  891.          * }
  892.          * ```
  893.          *
  894.          * ```yaml
  895.          * # api/config/api_platform/resources.yaml
  896.          * resources:
  897.          *     App\Entity\Book:
  898.          *         - paginationType: page
  899.          * ```
  900.          *
  901.          * ```xml
  902.          * <?xml version="1.0" encoding="UTF-8" ?>
  903.          * <!-- api/config/api_platform/resources.xml -->
  904.          * <resources
  905.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  906.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  907.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  908.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  909.          *     <resource class="App\Entity\Book" paginationType="page" />
  910.          * </resources>
  911.          * ```
  912.          * </CodeSelector>
  913.          */
  914.         protected ?string $paginationType null,
  915.         protected ?string $security null,
  916.         protected ?string $securityMessage null,
  917.         protected ?string $securityPostDenormalize null,
  918.         protected ?string $securityPostDenormalizeMessage null,
  919.         protected ?string $securityPostValidation null,
  920.         protected ?string $securityPostValidationMessage null,
  921.         protected ?bool $compositeIdentifier null,
  922.         protected ?array $exceptionToStatus null,
  923.         protected ?bool $queryParameterValidationEnabled null,
  924.         protected ?array $graphQlOperations null,
  925.         $provider null,
  926.         $processor null,
  927.         protected ?OptionsInterface $stateOptions null,
  928.         protected array $extraProperties = [],
  929.     ) {
  930.         $this->operations null === $operations null : new Operations($operations);
  931.         $this->provider $provider;
  932.         $this->processor $processor;
  933.         if (\is_string($types)) {
  934.             $this->types = (array) $types;
  935.         }
  936.     }
  937.     public function getOperations(): ?Operations
  938.     {
  939.         return $this->operations;
  940.     }
  941.     public function withOperations(Operations $operations): self
  942.     {
  943.         $self = clone $this;
  944.         $self->operations $operations;
  945.         return $self;
  946.     }
  947.     public function getUriTemplate(): ?string
  948.     {
  949.         return $this->uriTemplate;
  950.     }
  951.     public function withUriTemplate(string $uriTemplate): self
  952.     {
  953.         $self = clone $this;
  954.         $self->uriTemplate $uriTemplate;
  955.         return $self;
  956.     }
  957.     public function getShortName(): ?string
  958.     {
  959.         return $this->shortName;
  960.     }
  961.     public function withShortName(string $shortName): self
  962.     {
  963.         $self = clone $this;
  964.         $self->shortName $shortName;
  965.         return $self;
  966.     }
  967.     public function getDescription(): ?string
  968.     {
  969.         return $this->description;
  970.     }
  971.     public function withDescription(string $description): self
  972.     {
  973.         $self = clone $this;
  974.         $self->description $description;
  975.         return $self;
  976.     }
  977.     public function getTypes(): ?array
  978.     {
  979.         return $this->types;
  980.     }
  981.     /**
  982.      * @param string[]|string $types
  983.      */
  984.     public function withTypes(array|string $types): self
  985.     {
  986.         $self = clone $this;
  987.         $self->types = (array) $types;
  988.         return $self;
  989.     }
  990.     /**
  991.      * @return array|mixed|string|null
  992.      */
  993.     public function getFormats()
  994.     {
  995.         return $this->formats;
  996.     }
  997.     public function withFormats(mixed $formats): self
  998.     {
  999.         $self = clone $this;
  1000.         $self->formats $formats;
  1001.         return $self;
  1002.     }
  1003.     /**
  1004.      * @return array|mixed|string|null
  1005.      */
  1006.     public function getInputFormats()
  1007.     {
  1008.         return $this->inputFormats;
  1009.     }
  1010.     /**
  1011.      * @param mixed|null $inputFormats
  1012.      */
  1013.     public function withInputFormats($inputFormats): self
  1014.     {
  1015.         $self = clone $this;
  1016.         $self->inputFormats $inputFormats;
  1017.         return $self;
  1018.     }
  1019.     /**
  1020.      * @return array|mixed|string|null
  1021.      */
  1022.     public function getOutputFormats()
  1023.     {
  1024.         return $this->outputFormats;
  1025.     }
  1026.     /**
  1027.      * @param mixed|null $outputFormats
  1028.      */
  1029.     public function withOutputFormats($outputFormats): self
  1030.     {
  1031.         $self = clone $this;
  1032.         $self->outputFormats $outputFormats;
  1033.         return $self;
  1034.     }
  1035.     /**
  1036.      * @return array<string, Link>|array<string, array>|string[]|string|null
  1037.      */
  1038.     public function getUriVariables()
  1039.     {
  1040.         return $this->uriVariables;
  1041.     }
  1042.     /**
  1043.      * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
  1044.      */
  1045.     public function withUriVariables($uriVariables): self
  1046.     {
  1047.         $self = clone $this;
  1048.         $self->uriVariables $uriVariables;
  1049.         return $self;
  1050.     }
  1051.     public function getRoutePrefix(): ?string
  1052.     {
  1053.         return $this->routePrefix;
  1054.     }
  1055.     public function withRoutePrefix(string $routePrefix): self
  1056.     {
  1057.         $self = clone $this;
  1058.         $self->routePrefix $routePrefix;
  1059.         return $self;
  1060.     }
  1061.     public function getDefaults(): ?array
  1062.     {
  1063.         return $this->defaults;
  1064.     }
  1065.     public function withDefaults(array $defaults): self
  1066.     {
  1067.         $self = clone $this;
  1068.         $self->defaults $defaults;
  1069.         return $self;
  1070.     }
  1071.     public function getRequirements(): ?array
  1072.     {
  1073.         return $this->requirements;
  1074.     }
  1075.     public function withRequirements(array $requirements): self
  1076.     {
  1077.         $self = clone $this;
  1078.         $self->requirements $requirements;
  1079.         return $self;
  1080.     }
  1081.     public function getOptions(): ?array
  1082.     {
  1083.         return $this->options;
  1084.     }
  1085.     public function withOptions(array $options): self
  1086.     {
  1087.         $self = clone $this;
  1088.         $self->options $options;
  1089.         return $self;
  1090.     }
  1091.     public function getStateless(): ?bool
  1092.     {
  1093.         return $this->stateless;
  1094.     }
  1095.     public function withStateless(bool $stateless): self
  1096.     {
  1097.         $self = clone $this;
  1098.         $self->stateless $stateless;
  1099.         return $self;
  1100.     }
  1101.     public function getSunset(): ?string
  1102.     {
  1103.         return $this->sunset;
  1104.     }
  1105.     public function withSunset(string $sunset): self
  1106.     {
  1107.         $self = clone $this;
  1108.         $self->sunset $sunset;
  1109.         return $self;
  1110.     }
  1111.     public function getAcceptPatch(): ?string
  1112.     {
  1113.         return $this->acceptPatch;
  1114.     }
  1115.     public function withAcceptPatch(string $acceptPatch): self
  1116.     {
  1117.         $self = clone $this;
  1118.         $self->acceptPatch $acceptPatch;
  1119.         return $self;
  1120.     }
  1121.     public function getStatus(): ?int
  1122.     {
  1123.         return $this->status;
  1124.     }
  1125.     public function withStatus($status): self
  1126.     {
  1127.         $self = clone $this;
  1128.         $self->status $status;
  1129.         return $self;
  1130.     }
  1131.     public function getHost(): ?string
  1132.     {
  1133.         return $this->host;
  1134.     }
  1135.     public function withHost(string $host): self
  1136.     {
  1137.         $self = clone $this;
  1138.         $self->host $host;
  1139.         return $self;
  1140.     }
  1141.     public function getSchemes(): ?array
  1142.     {
  1143.         return $this->schemes;
  1144.     }
  1145.     public function withSchemes(array $schemes): self
  1146.     {
  1147.         $self = clone $this;
  1148.         $self->schemes $schemes;
  1149.         return $self;
  1150.     }
  1151.     public function getCondition(): ?string
  1152.     {
  1153.         return $this->condition;
  1154.     }
  1155.     public function withCondition(string $condition): self
  1156.     {
  1157.         $self = clone $this;
  1158.         $self->condition $condition;
  1159.         return $self;
  1160.     }
  1161.     public function getController(): ?string
  1162.     {
  1163.         return $this->controller;
  1164.     }
  1165.     public function withController(string $controller): self
  1166.     {
  1167.         $self = clone $this;
  1168.         $self->controller $controller;
  1169.         return $self;
  1170.     }
  1171.     public function getClass(): ?string
  1172.     {
  1173.         return $this->class;
  1174.     }
  1175.     public function withClass(string $class): self
  1176.     {
  1177.         $self = clone $this;
  1178.         $self->class $class;
  1179.         return $self;
  1180.     }
  1181.     public function getUrlGenerationStrategy(): ?int
  1182.     {
  1183.         return $this->urlGenerationStrategy;
  1184.     }
  1185.     public function withUrlGenerationStrategy(int $urlGenerationStrategy): self
  1186.     {
  1187.         $self = clone $this;
  1188.         $self->urlGenerationStrategy $urlGenerationStrategy;
  1189.         return $self;
  1190.     }
  1191.     public function getDeprecationReason(): ?string
  1192.     {
  1193.         return $this->deprecationReason;
  1194.     }
  1195.     public function withDeprecationReason(string $deprecationReason): self
  1196.     {
  1197.         $self = clone $this;
  1198.         $self->deprecationReason $deprecationReason;
  1199.         return $self;
  1200.     }
  1201.     public function getCacheHeaders(): ?array
  1202.     {
  1203.         return $this->cacheHeaders;
  1204.     }
  1205.     public function withCacheHeaders(array $cacheHeaders): self
  1206.     {
  1207.         $self = clone $this;
  1208.         $self->cacheHeaders $cacheHeaders;
  1209.         return $self;
  1210.     }
  1211.     public function getNormalizationContext(): ?array
  1212.     {
  1213.         return $this->normalizationContext;
  1214.     }
  1215.     public function withNormalizationContext(array $normalizationContext): self
  1216.     {
  1217.         $self = clone $this;
  1218.         $self->normalizationContext $normalizationContext;
  1219.         return $self;
  1220.     }
  1221.     public function getDenormalizationContext(): ?array
  1222.     {
  1223.         return $this->denormalizationContext;
  1224.     }
  1225.     public function withDenormalizationContext(array $denormalizationContext): self
  1226.     {
  1227.         $self = clone $this;
  1228.         $self->denormalizationContext $denormalizationContext;
  1229.         return $self;
  1230.     }
  1231.     public function getCollectDenormalizationErrors(): ?bool
  1232.     {
  1233.         return $this->collectDenormalizationErrors;
  1234.     }
  1235.     public function withCollectDenormalizationErrors(bool $collectDenormalizationErrors null): self
  1236.     {
  1237.         $self = clone $this;
  1238.         $self->collectDenormalizationErrors $collectDenormalizationErrors;
  1239.         return $self;
  1240.     }
  1241.     /**
  1242.      * @return string[]|null
  1243.      */
  1244.     public function getHydraContext(): ?array
  1245.     {
  1246.         return $this->hydraContext;
  1247.     }
  1248.     public function withHydraContext(array $hydraContext): self
  1249.     {
  1250.         $self = clone $this;
  1251.         $self->hydraContext $hydraContext;
  1252.         return $self;
  1253.     }
  1254.     /**
  1255.      * TODO Remove in 4.0.
  1256.      *
  1257.      * @deprecated
  1258.      */
  1259.     public function getOpenapiContext(): ?array
  1260.     {
  1261.         return $this->openapiContext;
  1262.     }
  1263.     /**
  1264.      * TODO Remove in 4.0.
  1265.      *
  1266.      * @deprecated
  1267.      */
  1268.     public function withOpenapiContext(array $openapiContext): self
  1269.     {
  1270.         $self = clone $this;
  1271.         $self->openapiContext $openapiContext;
  1272.         return $self;
  1273.     }
  1274.     public function getOpenapi(): bool|OpenApiOperation|null
  1275.     {
  1276.         return $this->openapi;
  1277.     }
  1278.     public function withOpenapi(bool|OpenApiOperation $openapi): self
  1279.     {
  1280.         $self = clone $this;
  1281.         $self->openapi $openapi;
  1282.         return $self;
  1283.     }
  1284.     public function getValidationContext(): ?array
  1285.     {
  1286.         return $this->validationContext;
  1287.     }
  1288.     public function withValidationContext(array $validationContext): self
  1289.     {
  1290.         $self = clone $this;
  1291.         $self->validationContext $validationContext;
  1292.         return $self;
  1293.     }
  1294.     /**
  1295.      * @return string[]|null
  1296.      */
  1297.     public function getFilters(): ?array
  1298.     {
  1299.         return $this->filters;
  1300.     }
  1301.     public function withFilters(array $filters): self
  1302.     {
  1303.         $self = clone $this;
  1304.         $self->filters $filters;
  1305.         return $self;
  1306.     }
  1307.     /**
  1308.      * @deprecated this will be removed in v4
  1309.      */
  1310.     public function getElasticsearch(): ?bool
  1311.     {
  1312.         return $this->elasticsearch;
  1313.     }
  1314.     /**
  1315.      * @deprecated this will be removed in v4
  1316.      */
  1317.     public function withElasticsearch(bool $elasticsearch): self
  1318.     {
  1319.         $self = clone $this;
  1320.         $self->elasticsearch $elasticsearch;
  1321.         return $self;
  1322.     }
  1323.     /**
  1324.      * @return array|bool|mixed|null
  1325.      */
  1326.     public function getMercure()
  1327.     {
  1328.         return $this->mercure;
  1329.     }
  1330.     public function withMercure($mercure): self
  1331.     {
  1332.         $self = clone $this;
  1333.         $self->mercure $mercure;
  1334.         return $self;
  1335.     }
  1336.     public function getMessenger()
  1337.     {
  1338.         return $this->messenger;
  1339.     }
  1340.     public function withMessenger($messenger): self
  1341.     {
  1342.         $self = clone $this;
  1343.         $self->messenger $messenger;
  1344.         return $self;
  1345.     }
  1346.     public function getInput()
  1347.     {
  1348.         return $this->input;
  1349.     }
  1350.     public function withInput($input): self
  1351.     {
  1352.         $self = clone $this;
  1353.         $self->input $input;
  1354.         return $self;
  1355.     }
  1356.     public function getOutput()
  1357.     {
  1358.         return $this->output;
  1359.     }
  1360.     public function withOutput($output): self
  1361.     {
  1362.         $self = clone $this;
  1363.         $self->output $output;
  1364.         return $self;
  1365.     }
  1366.     public function getOrder(): ?array
  1367.     {
  1368.         return $this->order;
  1369.     }
  1370.     public function withOrder(array $order): self
  1371.     {
  1372.         $self = clone $this;
  1373.         $self->order $order;
  1374.         return $self;
  1375.     }
  1376.     public function getFetchPartial(): ?bool
  1377.     {
  1378.         return $this->fetchPartial;
  1379.     }
  1380.     public function withFetchPartial(bool $fetchPartial): self
  1381.     {
  1382.         $self = clone $this;
  1383.         $self->fetchPartial $fetchPartial;
  1384.         return $self;
  1385.     }
  1386.     public function getForceEager(): ?bool
  1387.     {
  1388.         return $this->forceEager;
  1389.     }
  1390.     public function withForceEager(bool $forceEager): self
  1391.     {
  1392.         $self = clone $this;
  1393.         $self->forceEager $forceEager;
  1394.         return $self;
  1395.     }
  1396.     public function getPaginationClientEnabled(): ?bool
  1397.     {
  1398.         return $this->paginationClientEnabled;
  1399.     }
  1400.     public function withPaginationClientEnabled(bool $paginationClientEnabled): self
  1401.     {
  1402.         $self = clone $this;
  1403.         $self->paginationClientEnabled $paginationClientEnabled;
  1404.         return $self;
  1405.     }
  1406.     public function getPaginationClientItemsPerPage(): ?bool
  1407.     {
  1408.         return $this->paginationClientItemsPerPage;
  1409.     }
  1410.     public function withPaginationClientItemsPerPage(bool $paginationClientItemsPerPage): self
  1411.     {
  1412.         $self = clone $this;
  1413.         $self->paginationClientItemsPerPage $paginationClientItemsPerPage;
  1414.         return $self;
  1415.     }
  1416.     public function getPaginationClientPartial(): ?bool
  1417.     {
  1418.         return $this->paginationClientPartial;
  1419.     }
  1420.     public function withPaginationClientPartial(bool $paginationClientPartial): self
  1421.     {
  1422.         $self = clone $this;
  1423.         $self->paginationClientPartial $paginationClientPartial;
  1424.         return $self;
  1425.     }
  1426.     public function getPaginationViaCursor(): ?array
  1427.     {
  1428.         return $this->paginationViaCursor;
  1429.     }
  1430.     public function withPaginationViaCursor(array $paginationViaCursor): self
  1431.     {
  1432.         $self = clone $this;
  1433.         $self->paginationViaCursor $paginationViaCursor;
  1434.         return $self;
  1435.     }
  1436.     public function getPaginationEnabled(): ?bool
  1437.     {
  1438.         return $this->paginationEnabled;
  1439.     }
  1440.     public function withPaginationEnabled(bool $paginationEnabled): self
  1441.     {
  1442.         $self = clone $this;
  1443.         $self->paginationEnabled $paginationEnabled;
  1444.         return $self;
  1445.     }
  1446.     public function getPaginationFetchJoinCollection(): ?bool
  1447.     {
  1448.         return $this->paginationFetchJoinCollection;
  1449.     }
  1450.     public function withPaginationFetchJoinCollection(bool $paginationFetchJoinCollection): self
  1451.     {
  1452.         $self = clone $this;
  1453.         $self->paginationFetchJoinCollection $paginationFetchJoinCollection;
  1454.         return $self;
  1455.     }
  1456.     public function getPaginationUseOutputWalkers(): ?bool
  1457.     {
  1458.         return $this->paginationUseOutputWalkers;
  1459.     }
  1460.     public function withPaginationUseOutputWalkers(bool $paginationUseOutputWalkers): self
  1461.     {
  1462.         $self = clone $this;
  1463.         $self->paginationUseOutputWalkers $paginationUseOutputWalkers;
  1464.         return $self;
  1465.     }
  1466.     public function getPaginationItemsPerPage(): ?int
  1467.     {
  1468.         return $this->paginationItemsPerPage;
  1469.     }
  1470.     public function withPaginationItemsPerPage(int $paginationItemsPerPage): self
  1471.     {
  1472.         $self = clone $this;
  1473.         $self->paginationItemsPerPage $paginationItemsPerPage;
  1474.         return $self;
  1475.     }
  1476.     public function getPaginationMaximumItemsPerPage(): ?int
  1477.     {
  1478.         return $this->paginationMaximumItemsPerPage;
  1479.     }
  1480.     public function withPaginationMaximumItemsPerPage(int $paginationMaximumItemsPerPage): self
  1481.     {
  1482.         $self = clone $this;
  1483.         $self->paginationMaximumItemsPerPage $paginationMaximumItemsPerPage;
  1484.         return $self;
  1485.     }
  1486.     public function getPaginationPartial(): ?bool
  1487.     {
  1488.         return $this->paginationPartial;
  1489.     }
  1490.     public function withPaginationPartial(bool $paginationPartial): self
  1491.     {
  1492.         $self = clone $this;
  1493.         $self->paginationPartial $paginationPartial;
  1494.         return $self;
  1495.     }
  1496.     public function getPaginationType(): ?string
  1497.     {
  1498.         return $this->paginationType;
  1499.     }
  1500.     public function withPaginationType(string $paginationType): self
  1501.     {
  1502.         $self = clone $this;
  1503.         $self->paginationType $paginationType;
  1504.         return $self;
  1505.     }
  1506.     public function getSecurity(): ?string
  1507.     {
  1508.         return $this->security;
  1509.     }
  1510.     public function withSecurity(string $security): self
  1511.     {
  1512.         $self = clone $this;
  1513.         $self->security $security;
  1514.         return $self;
  1515.     }
  1516.     public function getSecurityMessage(): ?string
  1517.     {
  1518.         return $this->securityMessage;
  1519.     }
  1520.     public function withSecurityMessage(string $securityMessage): self
  1521.     {
  1522.         $self = clone $this;
  1523.         $self->securityMessage $securityMessage;
  1524.         return $self;
  1525.     }
  1526.     public function getSecurityPostDenormalize(): ?string
  1527.     {
  1528.         return $this->securityPostDenormalize;
  1529.     }
  1530.     public function withSecurityPostDenormalize(string $securityPostDenormalize): self
  1531.     {
  1532.         $self = clone $this;
  1533.         $self->securityPostDenormalize $securityPostDenormalize;
  1534.         return $self;
  1535.     }
  1536.     public function getSecurityPostDenormalizeMessage(): ?string
  1537.     {
  1538.         return $this->securityPostDenormalizeMessage;
  1539.     }
  1540.     public function withSecurityPostDenormalizeMessage(string $securityPostDenormalizeMessage): self
  1541.     {
  1542.         $self = clone $this;
  1543.         $self->securityPostDenormalizeMessage $securityPostDenormalizeMessage;
  1544.         return $self;
  1545.     }
  1546.     public function getSecurityPostValidation(): ?string
  1547.     {
  1548.         return $this->securityPostValidation;
  1549.     }
  1550.     public function withSecurityPostValidation(string $securityPostValidation null): self
  1551.     {
  1552.         $self = clone $this;
  1553.         $self->securityPostValidation $securityPostValidation;
  1554.         return $self;
  1555.     }
  1556.     public function getSecurityPostValidationMessage(): ?string
  1557.     {
  1558.         return $this->securityPostValidationMessage;
  1559.     }
  1560.     public function withSecurityPostValidationMessage(string $securityPostValidationMessage null): self
  1561.     {
  1562.         $self = clone $this;
  1563.         $self->securityPostValidationMessage $securityPostValidationMessage;
  1564.         return $self;
  1565.     }
  1566.     public function getExceptionToStatus(): ?array
  1567.     {
  1568.         return $this->exceptionToStatus;
  1569.     }
  1570.     public function withExceptionToStatus(array $exceptionToStatus): self
  1571.     {
  1572.         $self = clone $this;
  1573.         $self->exceptionToStatus $exceptionToStatus;
  1574.         return $self;
  1575.     }
  1576.     public function getQueryParameterValidationEnabled(): ?bool
  1577.     {
  1578.         return $this->queryParameterValidationEnabled;
  1579.     }
  1580.     public function withQueryParameterValidationEnabled(bool $queryParameterValidationEnabled): self
  1581.     {
  1582.         $self = clone $this;
  1583.         $self->queryParameterValidationEnabled $queryParameterValidationEnabled;
  1584.         return $self;
  1585.     }
  1586.     /**
  1587.      * @return GraphQlOperation[]
  1588.      */
  1589.     public function getGraphQlOperations(): ?array
  1590.     {
  1591.         return $this->graphQlOperations;
  1592.     }
  1593.     public function withGraphQlOperations(array $graphQlOperations): self
  1594.     {
  1595.         $self = clone $this;
  1596.         $self->graphQlOperations $graphQlOperations;
  1597.         return $self;
  1598.     }
  1599.     /**
  1600.      * @return string|callable|null
  1601.      */
  1602.     public function getProcessor()
  1603.     {
  1604.         return $this->processor;
  1605.     }
  1606.     public function withProcessor($processor): self
  1607.     {
  1608.         $self = clone $this;
  1609.         $self->processor $processor;
  1610.         return $self;
  1611.     }
  1612.     /**
  1613.      * @return string|callable|null
  1614.      */
  1615.     public function getProvider()
  1616.     {
  1617.         return $this->provider;
  1618.     }
  1619.     public function withProvider($provider): self
  1620.     {
  1621.         $self = clone $this;
  1622.         $self->provider $provider;
  1623.         return $self;
  1624.     }
  1625.     public function getExtraProperties(): array
  1626.     {
  1627.         return $this->extraProperties;
  1628.     }
  1629.     public function withExtraProperties(array $extraProperties): self
  1630.     {
  1631.         $self = clone $this;
  1632.         $self->extraProperties $extraProperties;
  1633.         return $self;
  1634.     }
  1635.     public function getStateOptions(): ?OptionsInterface
  1636.     {
  1637.         return $this->stateOptions;
  1638.     }
  1639.     public function withStateOptions(?OptionsInterface $stateOptions): self
  1640.     {
  1641.         $self = clone $this;
  1642.         $self->stateOptions $stateOptions;
  1643.         return $self;
  1644.     }
  1645. }