src/Domain/Entity/PointOfInterest/Revision.php line 622

Open in your IDE?
  1. <?php
  2. namespace App\Domain\Entity\PointOfInterest;
  3. use ApiPlatform\Metadata\ApiProperty;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Metadata\Delete;
  6. use ApiPlatform\Metadata\Get;
  7. use ApiPlatform\Metadata\GetCollection;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Put;
  10. use App\Application\ApiResources\State\Processor\RevisionCreateProcessor;
  11. use App\Application\ApiResources\State\Processor\RevisionPutProcessor;
  12. use App\Application\ApiResources\State\Processor\RevisionValidateProcessor;
  13. use App\Application\ApiResources\State\Provider\Revision\GetLatestMainWithPicturesProvider;
  14. use App\Application\ApiResources\State\Provider\Revision\GetLatestMainWithPicturesValidatedProvider;
  15. use App\Application\ApiResources\State\Provider\Revision\GetMainWithPicturesProvider;
  16. use App\Application\ApiResources\State\Provider\Revision\RevisionProvider;
  17. use App\Application\Controller\Api\LogUserSearch\LogUserSearchAction;
  18. use App\Application\Controller\Api\Revision\GetLatestFavoritesAction;
  19. use App\Application\Controller\Api\Revision\GetNearbyAction;
  20. use App\Application\Controller\Api\Revision\GetPdfAction;
  21. use App\Application\Controller\Api\Revision\GetSelectAction;
  22. use App\Application\Controller\Api\Revision\GetStructuredDataAction;
  23. use App\Application\Controller\Api\Revision\RevisionFavoriteDataController;
  24. use App\Application\Controller\Api\Revision\RevisionIncrementAction;
  25. use App\Application\Controller\Api\Revision\RevisionIncrementClickCounterController;
  26. use App\Application\Controller\Api\Revision\RevisionIncrementDetailViewCounterController;
  27. use App\Application\Controller\Api\Revision\RevisionSuggestionController;
  28. use App\Application\Controller\Api\Revision\SearchAction;
  29. use App\Application\Controller\Api\Revision\SendMessageAction;
  30. use App\Application\Controller\Api\Revision\ShareEmailAction;
  31. use App\Application\Dto\PointOfInterest\RevisionSearchOutput;
  32. use App\Application\Dto\SendMessageInput;
  33. use App\Application\Dto\ShareInput;
  34. use App\Domain\Entity\Address;
  35. use App\Domain\Entity\Behavior\Identifiable;
  36. use App\Domain\Entity\Enumeration\CurrencyType;
  37. use App\Domain\Entity\Enumeration\FloorQuality;
  38. use App\Domain\Entity\Enumeration\FloorType;
  39. use App\Domain\Entity\Enumeration\Label;
  40. use App\Domain\Entity\Enumeration\Network;
  41. use App\Domain\Entity\Enumeration\ParkingTime;
  42. use App\Domain\Entity\Enumeration\ParkingType;
  43. use App\Domain\Entity\Enumeration\PaymentType;
  44. use App\Domain\Entity\Enumeration\PointOfInterestType;
  45. use App\Domain\Entity\Person;
  46. use App\Domain\Entity\PointOfInterest;
  47. use App\Domain\Entity\Region;
  48. use App\Domain\Entity\Translation\RevisionTranslation;
  49. use Doctrine\Common\Collections\ArrayCollection;
  50. use Doctrine\Common\Collections\Collection;
  51. use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
  52. use Gedmo\Timestampable\Traits\Timestampable;
  53. use Locastic\ApiPlatformTranslationBundle\Model\AbstractTranslatable;
  54. /**
  55.  * Class Revision
  56.  *
  57.  * @package App\Domain\Entity\Revision
  58.  */
  59. #[ApiResource(
  60.     operations: [
  61.         new GetCollection(
  62.             filters: [
  63.                 'revision.search_filter',
  64.                 'revision.query_filter',
  65.                 'revision.order_filter',
  66.                 'revision.type_filter',
  67.                 'revision.service_filter',
  68.                 'revision.notation_filter',
  69.                 'revision.minimum_height_filter',
  70.                 'revision.minimum_width_filter',
  71.                 'revision.exists_filter',
  72.                 'soft_delete_filter',
  73.             ],
  74.         ),
  75.         new GetCollection(
  76.             uriTemplate'revisions_location',
  77.             normalizationContext: ['groups' => ['revision_location_read']],
  78.             filters: [
  79.                 'revision.search_filter',
  80.                 'revision.query_filter',
  81.                 'revision.order_filter',
  82.                 'revision.type_filter',
  83.                 'revision.service_filter',
  84.                 'revision.notation_filter',
  85.                 'revision.minimum_height_filter',
  86.                 'revision.minimum_width_filter',
  87.                 'revision.exists_filter',
  88.                 'soft_delete_filter',
  89.             ],
  90.         ),
  91.         new GetCollection(
  92.             uriTemplate'/main_revisions',
  93.             controllerSearchAction::class,
  94.             openapiContext: [
  95.                 'summary' => 'Get main revision list',
  96.                 'parameters' => [
  97.                     [
  98.                         'name' => 'filters[type.uuid]',
  99.                         'in' => 'query',
  100.                         'schema' => [
  101.                             'type' => 'array',
  102.                             'items' => [
  103.                                 'type' => 'string',
  104.                             ],
  105.                         ],
  106.                         'description' => 'Filter by Point of Interest Type uuid',
  107.                         'required' => false,
  108.                         'example' => [
  109.                             "cbb9076d-a63d-47a1-b2db-86dd6ef15b4e",
  110.                         ],
  111.                     ],
  112.                     [
  113.                         'name' => 'filters[attributesDetail]',
  114.                         'in' => 'query',
  115.                         'schema' => [
  116.                             'type' => 'array',
  117.                             'items' => [
  118.                                 'type' => 'integer',
  119.                             ],
  120.                         ],
  121.                         'description' => 'Filter by price range [ min, max, Show price if unknown ]',
  122.                         'required' => false,
  123.                         'example' => [
  124.                             0,
  125.                             200,
  126.                             1,
  127.                         ],
  128.                     ],
  129.                     [
  130.                         'name' => 'filters[firstAverageGrade]',
  131.                         'in' => 'query',
  132.                         'schema' => [
  133.                             'type' => 'boolean',
  134.                         ],
  135.                         'description' => 'Filter by average grade > 4.5',
  136.                         'required' => false,
  137.                         'example' => true,
  138.                     ],
  139.                     [
  140.                         'name' => 'filters[secondAverageGrade]',
  141.                         'in' => 'query',
  142.                         'schema' => [
  143.                             'type' => 'boolean',
  144.                         ],
  145.                         'description' => 'Filter by average grade > 4',
  146.                         'required' => false,
  147.                         'example' => true,
  148.                     ],
  149.                     [
  150.                         'name' => 'filters[thirdAverageGrade]',
  151.                         'in' => 'query',
  152.                         'schema' => [
  153.                             'type' => 'boolean',
  154.                         ],
  155.                         'description' => 'Filter by average grade > 3.5',
  156.                         'required' => false,
  157.                         'example' => true,
  158.                     ],
  159.                     [
  160.                         'name' => 'filters[fourthAverageGrade]',
  161.                         'in' => 'query',
  162.                         'schema' => [
  163.                             'type' => 'boolean',
  164.                         ],
  165.                         'description' => 'Filter by average grade > 5',
  166.                         'required' => false,
  167.                         'example' => true,
  168.                     ],
  169.                     [
  170.                         'name' => 'filters[minimumHeight]',
  171.                         'in' => 'query',
  172.                         'schema' => [
  173.                             'type' => 'number',
  174.                         ],
  175.                         'description' => 'Filter by minimum height',
  176.                         'required' => false,
  177.                         'example' => 1.8,
  178.                     ],
  179.                     [
  180.                         'name' => 'filters[minimumWidth]',
  181.                         'in' => 'query',
  182.                         'schema' => [
  183.                             'type' => 'number',
  184.                         ],
  185.                         'description' => 'Filter by minimum width',
  186.                         'required' => false,
  187.                         'example' => 1.8,
  188.                     ],
  189.                     [
  190.                         'name' => 'filters[minimumLength]',
  191.                         'in' => 'query',
  192.                         'schema' => [
  193.                             'type' => 'number',
  194.                         ],
  195.                         'description' => 'Filter by minimum width',
  196.                         'required' => false,
  197.                         'example' => 1.8,
  198.                     ],
  199.                     [
  200.                         'name' => 'filters[openingDate]',
  201.                         'in' => 'query',
  202.                         'schema' => [
  203.                             'type' => 'string',
  204.                             'format' => 'date',
  205.                         ],
  206.                         'description' => 'Filter by opening date',
  207.                         'required' => false,
  208.                     ],
  209.                     [
  210.                         'name' => 'filters[range][lat]',
  211.                         'in' => 'query',
  212.                         'schema' => [
  213.                             'type' => 'number',
  214.                         ],
  215.                         'description' => 'Latitude of the center point for the radius filter (in decimal degrees)',
  216.                         'required' => false,
  217.                     ],
  218.                     [
  219.                         'name' => 'filters[range][lng]',
  220.                         'in' => 'query',
  221.                         'schema' => [
  222.                             'type' => 'number',
  223.                         ],
  224.                         'description' => 'Longitude of the center point for the radius filter (in decimal degrees)',
  225.                         'required' => false,
  226.                     ],
  227.                     [
  228.                         'name' => 'filters[range][distance]',
  229.                         'in' => 'query',
  230.                         'schema' => [
  231.                             'type' => 'string',
  232.                         ],
  233.                         'description' => 'Distance radius in kilometers or miles (e.g. 200km)',
  234.                         'required' => false,
  235.                     ],
  236.                     [
  237.                         'name' => 'filters[bounds][top]',
  238.                         'in' => 'query',
  239.                         'schema' => [
  240.                             'type' => 'number',
  241.                         ],
  242.                         'description' => 'Northernmost latitude of the bounding box (in decimal degrees)',
  243.                         'required' => false,
  244.                     ],
  245.                     [
  246.                         'name' => 'filters[bounds][bottom]',
  247.                         'in' => 'query',
  248.                         'schema' => [
  249.                             'type' => 'number',
  250.                         ],
  251.                         'description' => 'Southernmost latitude of the bounding box (in decimal degrees)',
  252.                         'required' => false,
  253.                     ],
  254.                     [
  255.                         'name' => 'filters[bounds][left]',
  256.                         'in' => 'query',
  257.                         'schema' => [
  258.                             'type' => 'number',
  259.                         ],
  260.                         'description' => 'Westernmost longitude of the bounding box (in decimal degrees)',
  261.                         'required' => false,
  262.                     ],
  263.                     [
  264.                         'name' => 'filters[bounds][right]',
  265.                         'in' => 'query',
  266.                         'schema' => [
  267.                             'type' => 'number',
  268.                         ],
  269.                         'description' => 'Easternmost longitude of the bounding box (in decimal degrees)',
  270.                         'required' => false,
  271.                     ],
  272.                     [
  273.                         'name' => 'filters[search]',
  274.                         'in' => 'query',
  275.                         'schema' => [
  276.                             'type' => 'string',
  277.                         ],
  278.                         'description' => 'Search query string to filter by activity name',
  279.                         'required' => false,
  280.                     ],
  281.                 ],
  282.                 'responses' => [
  283.                     '200' => [
  284.                         'description' => 'List of main revisions',
  285.                         'content' => [
  286.                             'application/json' => [
  287.                                 'schema' => [
  288.                                     'type' => 'object',
  289.                                     'properties' => [
  290.                                         'lastPage' => [
  291.                                             'type' => 'integer',
  292.                                         ],
  293.                                         'totalItems' => [
  294.                                             'type' => 'integer',
  295.                                         ],
  296.                                         'items' => [
  297.                                             'type' => 'array',
  298.                                             'items' => [
  299.                                                 'type' => 'object',
  300.                                                 'properties' => [
  301.                                                     'id' => [
  302.                                                         'type' => 'integer',
  303.                                                     ],
  304.                                                     'uuid' => [
  305.                                                         'type' => 'string',
  306.                                                     ],
  307.                                                     'name' => [
  308.                                                         'type' => 'string',
  309.                                                     ],
  310.                                                     'maxLength' => [
  311.                                                         'type' => 'number',
  312.                                                     ],
  313.                                                     'maxHeight' => [
  314.                                                         'type' => 'number',
  315.                                                     ],
  316.                                                     'maxWidth' => [
  317.                                                         'type' => 'number',
  318.                                                     ],
  319.                                                     'attributes' => [
  320.                                                         'type' => 'array',
  321.                                                         'items' => [
  322.                                                             'type' => 'object',
  323.                                                             'properties' => [
  324.                                                                 'id' => [
  325.                                                                     'type' => 'integer',
  326.                                                                 ],
  327.                                                                 'detail' => [
  328.                                                                     'type' => 'string',
  329.                                                                 ],
  330.                                                                 'attribute' => [
  331.                                                                     'type' => 'object',
  332.                                                                     'properties' => [
  333.                                                                         'id' => [
  334.                                                                             'type' => 'integer',
  335.                                                                         ],
  336.                                                                         'uuid' => [
  337.                                                                             'type' => 'string',
  338.                                                                         ],
  339.                                                                         'type' => [
  340.                                                                             'type' => 'string',
  341.                                                                         ],
  342.                                                                         'category' => [
  343.                                                                             'type' => 'object',
  344.                                                                             'properties' => [
  345.                                                                                 'code' => [
  346.                                                                                     'type' => 'string',
  347.                                                                                 ],
  348.                                                                             ],
  349.                                                                         ],
  350.                                                                         'picto' => [
  351.                                                                             'type' => 'object',
  352.                                                                             'properties' => [
  353.                                                                                 'uuid' => [
  354.                                                                                     'type' => 'string',
  355.                                                                                 ],
  356.                                                                             ],
  357.                                                                         ],
  358.                                                                     ],
  359.                                                                 ],
  360.                                                             ],
  361.                                                         ],
  362.                                                     ],
  363.                                                     'type' => [
  364.                                                         'type' => 'object',
  365.                                                         'properties' => [
  366.                                                             'code' => [
  367.                                                                 'type' => 'string',
  368.                                                             ],
  369.                                                             'uuid' => [
  370.                                                                 'type' => 'string',
  371.                                                             ],
  372.                                                             'position' => [
  373.                                                                 'type' => 'integer',
  374.                                                             ],
  375.                                                         ],
  376.                                                     ],
  377.                                                     'address' => [
  378.                                                         'type' => 'object',
  379.                                                         'properties' => [
  380.                                                             'id' => [
  381.                                                                 'type' => 'string',
  382.                                                             ],
  383.                                                             'lat' => [
  384.                                                                 'type' => 'integer',
  385.                                                             ],
  386.                                                             'lng' => [
  387.                                                                 'type' => 'integer',
  388.                                                             ],
  389.                                                             'cityName' => [
  390.                                                                 'type' => 'string',
  391.                                                             ],
  392.                                                             'zipCode' => [
  393.                                                                 'type' => 'string',
  394.                                                             ],
  395.                                                             'country' => [
  396.                                                                 'type' => 'string',
  397.                                                             ],
  398.                                                             'streetName' => [
  399.                                                                 'type' => 'string',
  400.                                                             ],
  401.                                                         ],
  402.                                                     ],
  403.                                                     'pointOfInterest' => [
  404.                                                         'type' => 'object',
  405.                                                         'properties' => [
  406.                                                             'id' => [
  407.                                                                 'type' => 'integer',
  408.                                                             ],
  409.                                                             'uuid' => [
  410.                                                                 'type' => 'string',
  411.                                                             ],
  412.                                                             'averageNotation' => [
  413.                                                                 'type' => 'object',
  414.                                                                 'properties' => [
  415.                                                                     'id' => [
  416.                                                                         'type' => 'integer',
  417.                                                                     ],
  418.                                                                     'uuid' => [
  419.                                                                         'type' => 'string',
  420.                                                                     ],
  421.                                                                     'averageNotation' => [
  422.                                                                         'type' => 'number',
  423.                                                                     ],
  424.                                                                     'mainPicture' => [
  425.                                                                         'type' => 'object',
  426.                                                                         'properties' => [
  427.                                                                             'uuid' => [
  428.                                                                                 'type' => 'string',
  429.                                                                             ],
  430.                                                                         ],
  431.                                                                     ],
  432.                                                                     'pictures' => [
  433.                                                                         'type' => 'object',
  434.                                                                         'properties' => [
  435.                                                                             'media' => [
  436.                                                                                 'type' => 'object',
  437.                                                                                 'properties' => [
  438.                                                                                     'uuid' => [
  439.                                                                                         'type' => 'string',
  440.                                                                                     ],
  441.                                                                                 ],
  442.                                                                             ],
  443.                                                                         ],
  444.                                                                     ],
  445.                                                                     'author' => [
  446.                                                                         'type' => 'object',
  447.                                                                         'properties' => [
  448.                                                                             'id' => [
  449.                                                                                 'type' => 'integer',
  450.                                                                             ],
  451.                                                                             'name' => [
  452.                                                                                 'type' => 'string',
  453.                                                                             ],
  454.                                                                         ],
  455.                                                                     ],
  456.                                                                     'comments' => [
  457.                                                                         'type' => 'object',
  458.                                                                         'properties' => [
  459.                                                                             'id' => [
  460.                                                                                 'type' => 'integer',
  461.                                                                             ],
  462.                                                                             'notation' => [
  463.                                                                                 'type' => 'integer',
  464.                                                                             ],
  465.                                                                         ],
  466.                                                                     ],
  467.                                                                 ],
  468.                                                             ],
  469.                                                             'campingInformation' => [
  470.                                                                 'type' => 'object',
  471.                                                                 'properties' => [
  472.                                                                     'animal' => [
  473.                                                                         'type' => 'boolean',
  474.                                                                     ],
  475.                                                                     'notation' => [
  476.                                                                         'type' => 'integer',
  477.                                                                     ],
  478.                                                                 ],
  479.                                                             ],
  480.                                                         ],
  481.                                                     ],
  482.                                                 ],
  483.                                             ],
  484.                                         ],
  485.                                     ],
  486.                                 ],
  487.                             ],
  488.                         ],
  489.                     ],
  490.                 ],
  491.             ],
  492.             validationContext: [],
  493.             outputRevisionSearchOutput::class,
  494.             readfalse,
  495.             deserializefalse,
  496.             writefalse,
  497.             name'search_main_revisions',
  498.         ),
  499.         new GetCollection(
  500.             uriTemplate'/revisions/elastic',
  501.             controllerSearchAction::class,
  502.             outputRevisionSearchOutput::class,
  503.             name'elastic_revisions',
  504.         ),
  505.         new GetCollection(
  506.             uriTemplate'/revisions/latest_main_with_pictures',
  507.             filters: ['revision.search_filter'],
  508.             providerGetLatestMainWithPicturesProvider::class,
  509.         ),
  510.         new GetCollection(
  511.             uriTemplate'/revisions/latest_main_with_pictures_validated',
  512.             filters: ['revision.search_filter'],
  513.             providerGetLatestMainWithPicturesValidatedProvider::class,
  514.         ),
  515.         new GetCollection(
  516.             uriTemplate'/revisions/by_department',
  517.             paginationEnabledtrue,
  518.             filters: [
  519.                 'revision.query_filter',
  520.                 'revision.order_filter',
  521.                 'revision.search_filter',
  522.                 'soft_delete_filter',
  523.             ],
  524.             providerRevisionProvider::class,
  525.         ),
  526.         new GetCollection(
  527.             uriTemplate'/revisions/main_with_pictures',
  528.             normalizationContext: ['groups' => ['base_revision_read']],
  529.             providerGetMainWithPicturesProvider::class,
  530.         ),
  531.         new GetCollection(
  532.             uriTemplate'/revisions/latest_favorites',
  533.             controllerGetLatestFavoritesAction::class,
  534.             name'get_latest_favorites',
  535.         ),
  536.         new GetCollection(
  537.             uriTemplate'/revisions/nearby',
  538.             controllerGetNearbyAction::class,
  539.             openapiContext: [
  540.                 'parameters' => [
  541.                     ['name' => 'lat''in' => 'query''required' => true'schema' => ['type' => 'number']],
  542.                     ['name' => 'lng''in' => 'query''required' => true'schema' => ['type' => 'number']],
  543.                     ['name' => 'distance''in' => 'query''required' => true'schema' => ['type' => 'integer']],
  544.                     ['name' => 'limit''in' => 'query''required' => false'schema' => ['type' => 'integer']],
  545.                     ['name' => 'revisionId''in' => 'query''required' => false'schema' => ['type' => 'string']]
  546.                 ],
  547.             ],
  548.         ),
  549.         new Get(name'get_revision'),
  550.         new Get(
  551.             uriTemplate'/revisions/{uuid}/favorite_data',
  552.             controllerRevisionFavoriteDataController::class,
  553.             name'get_favorite_data',
  554.         ),
  555.         new Get(
  556.             uriTemplate'/revisions/{uuid}/select',
  557.             controllerGetSelectAction::class,
  558.             security"is_granted('ROLE_ADMIN')",
  559.         ),
  560.         new Get(
  561.             uriTemplate'/revisions/{uuid}/pdf',
  562.             controllerGetPdfAction::class,
  563.         ),
  564.         new Get(
  565.             uriTemplate'/revisions/{uuid}/structured_data',
  566.             controllerGetStructuredDataAction::class,
  567.             name'get_revision_structured_data',
  568.         ),
  569.         new Get(
  570.             uriTemplate'/revisions/{uuid}/select',
  571.             controllerGetSelectAction::class,
  572.             security"is_granted('ROLE_ADMIN')",
  573.         ),
  574.         new Post(processorRevisionCreateProcessor::class),
  575.         new Post(
  576.             uriTemplate'/revisions/{uuid}/share_email',
  577.             controllerShareEmailAction::class,
  578.             inputShareInput::class,
  579.             readfalse,
  580.             deserializefalse,
  581.         ),
  582.         new Post(
  583.             uriTemplate'/revisions/{uuid}/message',
  584.             controllerSendMessageAction::class,
  585.             inputSendMessageInput::class,
  586.             readfalse,
  587.             deserializefalse,
  588.         ),
  589.         new Put(
  590.             processorRevisionPutProcessor::class,
  591.         ),
  592.         new Post(
  593.             uriTemplate'/revisions/increment',
  594.             controllerRevisionIncrementAction::class,
  595.             security"is_granted('ROLE_USER')",
  596.         ),
  597.         new Put(
  598.             uriTemplate'/revisions/{uuid}/validate',
  599.             security"is_granted('ROLE_ADMIN')",
  600.             processorRevisionValidateProcessor::class,
  601.         ),
  602.         new Delete(security"is_granted('ROLE_ADMIN')"),
  603.         new Post(
  604.             uriTemplate'/revisions/{uuid}/increment_detail_view_counter',
  605.             controllerRevisionIncrementDetailViewCounterController::class
  606.         ),
  607.         new Post(
  608.             uriTemplate'/revisions/{uuid}/increment_click_counter',
  609.             controllerRevisionIncrementClickCounterController::class,
  610.         ),
  611.         new Post(
  612.             uriTemplate'/revisions/{uuid}/suggestion',
  613.             controllerRevisionSuggestionController::class,
  614.         )
  615.     ],
  616.     normalizationContext: ['groups' => ['revision_read']],
  617.     denormalizationContext: ['groups' => ['revision_write']]
  618. )]
  619. class Revision extends AbstractTranslatable
  620. {
  621.     use Identifiable;
  622.     use SoftDeleteable;
  623.     use Timestampable;
  624.     /** @var Collection<RevisionAttribute> */
  625.     public Collection $attributes;
  626.     /** @var Collection<Label> */
  627.     public Collection $labels;
  628.     /** @var Collection<OpeningDate> */
  629.     public Collection $openingDates;
  630.     /** @var Collection<OpeningHour> */
  631.     public Collection $openingHours;
  632.     /** @var Collection<PaymentType> */
  633.     public Collection $paymentTypes;
  634.     public ?string $remoteId null;
  635.     public const SERVICE_PARKING_FIELD 'parking';
  636.     public const SERVICE_PARKING_SERVICE_FIELD 'parkingService';
  637.     public const SERVICE_PARKING_ELECTRICITY 'parkingElectricity';
  638.     public const SERVICE_PARKING_WATER 'parkingWater';
  639.     public const SERVICE_PACKAGE_CAMPER_VAN_FIELD 'packageCamperVan';
  640.     public const SERVICE_PACKAGE_CARAVAN_FIELD 'packageCaravan';
  641.     public const SLEEP 'sleep';
  642.     /**
  643.      * @param Address                 $address
  644.      * @param CampingInformation      $campingInformation
  645.      * @param string                  $name
  646.      * @param PointOfInterest         $pointOfInterest
  647.      * @param PointOfInterestType     $type
  648.      * @param bool                    $certified
  649.      * @param bool                    $gpsCertified
  650.      * @param bool                    $main
  651.      * @param Person|null             $certifiedBy
  652.      * @param ContactInformation|null $contactInformation
  653.      * @param CurrencyType|null       $currency
  654.      * @param FloorQuality|null       $floorQuality
  655.      * @param FloorType|null          $floorType
  656.      * @param string|null             $internalNote
  657.      * @param float|null              $maxLength
  658.      * @param float|null              $maxHeight
  659.      * @param float|null              $maxWidth
  660.      * @param Network|null            $network
  661.      * @param int|null                $nbCarPlace
  662.      * @param int|null                $nbChargingPoint
  663.      * @param int|null                $number
  664.      * @param string|null             $openingDescription
  665.      * @param ParkingTime|null        $parkingTime
  666.      * @param ParkingType|null        $parkingType
  667.      * @param Region|null             $region
  668.      * @param float|null              $parking
  669.      * @param float|null              $parkingService
  670.      * @param float|null              $packageCamperVan
  671.      * @param float|null              $packageCaravan
  672.      * @param bool|null               $isTemporaryClosed
  673.      * @param string|null             $temporaryClosedReason
  674.      * @param array                   $translations
  675.      * @param string|null             $createdFrom
  676.      * 
  677.      */
  678.     public function __construct(
  679.         #[ApiProperty(openapiContext: ['nullable' => false])]
  680.         public Address $address,
  681.         #[ApiProperty(openapiContext: ['nullable' => false])]
  682.         public CampingInformation $campingInformation,
  683.         #[ApiProperty(openapiContext: ['nullable' => false])]
  684.         public string $name,
  685.         #[ApiProperty(openapiContext: ['nullable' => false])]
  686.         public PointOfInterest $pointOfInterest,
  687.         #[ApiProperty(openapiContext: ['nullable' => false])]
  688.         public PointOfInterestType $type,
  689.         #[ApiProperty(openapiContext: ['nullable' => false])]
  690.         public bool $certified false,
  691.         #[ApiProperty(openapiContext: ['nullable' => false])]
  692.         public bool $gpsCertified false,
  693.         #[ApiProperty(openapiContext: ['nullable' => false])]
  694.         public bool $main false,
  695.         public ?Person $certifiedBy null,
  696.         public ?ContactInformation $contactInformation null,
  697.         public ?CurrencyType $currency null,
  698.         public ?FloorQuality $floorQuality null,
  699.         public ?FloorType $floorType null,
  700.         public ?string $internalNote null,
  701.         public ?float $maxLength null,
  702.         public ?float $maxHeight null,
  703.         public ?float $maxWidth null,
  704.         public ?Network $network null,
  705.         public ?int $nbCarPlace null,
  706.         public ?int $nbChargingPoint null,
  707.         public ?int $number 0,
  708.         public ?string $openingDescription null,
  709.         public ?ParkingTime $parkingTime null,
  710.         public ?ParkingType $parkingType null,
  711.         public ?Region $region null,
  712.         public ?float $parking null,
  713.         public ?float $parkingService null,
  714.         public ?float $packageCamperVan null,
  715.         public ?float $packageCaravan null,
  716.         public ?bool $isTemporaryClosed null,
  717.         public ?string $temporaryClosedReason null,
  718.         public ?string $createdFrom null,
  719.     ) {
  720.         $this->attributes = new ArrayCollection();
  721.         $this->labels = new ArrayCollection();
  722.         $this->openingDates = new ArrayCollection();
  723.         $this->openingHours = new ArrayCollection();
  724.         $this->paymentTypes = new ArrayCollection();
  725.         $this->translations = new ArrayCollection();
  726.     }
  727.     public function __clone()
  728.     {
  729.         $this->id null;
  730.         $this->uuid null;
  731.         $this->createdAt null;
  732.         $this->updatedAt null;
  733.         $this->main false;
  734.         $cCampingInformation = clone $this->campingInformation;
  735.         $cCampingInformation->id null;
  736.         $cCampingInformation->uuid null;
  737.         $this->campingInformation $cCampingInformation;
  738.         $cAddress = clone $this->address;
  739.         $cAddress->id null;
  740.         $cAddress->uuid null;
  741.         $this->address $cAddress;
  742.         $cContactInformation = clone $this->contactInformation;
  743.         $cContactInformation->id null;
  744.         $cContactInformation->uuid null;
  745.         $this->contactInformation $cContactInformation;
  746.         $this->paymentTypes = new ArrayCollection();
  747.         $this->labels = new ArrayCollection();
  748.     }
  749.     /**
  750.      * @return int
  751.      */
  752.     public function getId(): int
  753.     {
  754.         return $this->id;
  755.     }
  756.     /**
  757.      * @param RevisionAttribute $revisionAttribute
  758.      *
  759.      * @return self
  760.      */
  761.     public function addAttribute(RevisionAttribute $revisionAttribute): self
  762.     {
  763.         if (!$this->attributes->contains($revisionAttribute)) {
  764.             $this->attributes->add($revisionAttribute);
  765.         }
  766.         return $this;
  767.     }
  768.     public function addOpeningDate(OpeningDate $openingDate): self
  769.     {
  770.         $this->openingDates->add($openingDate);
  771.         return $this;
  772.     }
  773.     public function addOpeningHour(OpeningHour $openingHour): self
  774.     {
  775.         $this->openingHours->add($openingHour);
  776.         return $this;
  777.     }
  778.     public function addPaymentType(PaymentType $paymentType): self
  779.     {
  780.         $this->paymentTypes->add($paymentType);
  781.         return $this;
  782.     }
  783.     public function getFormattedUpdatedAt(): string
  784.     {
  785.         return $this->updatedAt->format('d/m/Y');
  786.     }
  787.     public function isElasticSearchPublishable(): bool
  788.     {
  789.         return $this->main && $this->deletedAt === null;
  790.     }
  791.     public function removeAttribute(RevisionAttribute $revisionAttribute): self
  792.     {
  793.         $this->attributes->removeElement($revisionAttribute);
  794.         return $this;
  795.     }
  796.     public function removeOpeningDate(OpeningDate $openingDate): self
  797.     {
  798.         $this->openingDates->removeElement($openingDate);
  799.         return $this;
  800.     }
  801.     public function removeOpeningHour(OpeningHour $openingHour): self
  802.     {
  803.         $this->openingHours->removeElement($openingHour);
  804.         return $this;
  805.     }
  806.     public function removePaymentType(PaymentType $paymentType): self
  807.     {
  808.         $this->paymentTypes->removeElement($paymentType);
  809.         return $this;
  810.     }
  811.     /**
  812.      * @return Collection
  813.      */
  814.     public function getLabels(): Collection
  815.     {
  816.         return $this->labels;
  817.     }
  818.     /**
  819.      * @param Collection $labels
  820.      */
  821.     public function setLabels(Collection $labels): void
  822.     {
  823.         $this->labels $labels;
  824.     }
  825.     public function addLabel(Label $label): self
  826.     {
  827.         $this->labels->add($label);
  828.         return $this;
  829.     }
  830.     public function removeLabel(Label $label): self
  831.     {
  832.         $this->labels->removeElement($label);
  833.         return $this;
  834.     }
  835.     /**
  836.      * @return Collection
  837.      */
  838.     public function getPaymentTypes(): Collection
  839.     {
  840.         return $this->paymentTypes;
  841.     }
  842.     /**
  843.      * @param Collection $paymentTypes
  844.      */
  845.     public function setPaymentTypes(Collection $paymentTypes): void
  846.     {
  847.         $this->paymentTypes $paymentTypes;
  848.     }
  849.     /**
  850.      * @return Address
  851.      */
  852.     public function getAddress(): Address
  853.     {
  854.         return $this->address;
  855.     }
  856.     /**
  857.      * @return Collection
  858.      */
  859.     public function getAttributes(): Collection
  860.     {
  861.         return $this->attributes;
  862.     }
  863.     /**
  864.      * @return PointOfInterestType
  865.      */
  866.     public function getType(): PointOfInterestType
  867.     {
  868.         return $this->type;
  869.     }
  870.     public function createTranslation(): RevisionTranslation
  871.     {
  872.         return new RevisionTranslation();
  873.     }
  874.     public function getDescription(): ?string
  875.     {
  876.         return $this->getTranslationType()->getDescription();
  877.     }
  878.     public function setDescription(?string $value): void
  879.     {
  880.         $this->getTranslationType()->setDescription($value);
  881.     }
  882.     public function getTranslationType(?string $locale null): RevisionTranslation
  883.     {
  884.         return $this->getTranslation($locale);
  885.     }
  886. }