src/Entity/DockingRestriction.php line 52

Open in your IDE?
  1. <?php
  2. // @deprecated
  3. declare(strict_types=1);
  4. namespace App\Entity;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use ApiPlatform\Core\Annotation\ApiProperty;
  7. use App\Trait\TimestampableEntity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. use Ramsey\Uuid\Uuid;
  12. use Ramsey\Uuid\UuidInterface;
  13. /**
  14.  * Represents docking restrictions for vessels.
  15.  *
  16.  * @see https://schema.org/DockingRestriction
  17.  */
  18. #[ORM\Entity]
  19. #[ApiResource(
  20.     iri'DockingRestriction',
  21.     itemOperations: [
  22.         'get' => [
  23.             'normalization_context' => ['groups' => 'docking_restriction:item:get''enable_max_depth' => true],
  24.         ],
  25.         'put' => [
  26.             'normalization_context' => ['groups' => 'docking_restriction:item:put''enable_max_depth' => true],
  27.             'denormalization_context' => ['groups' => 'docking_restriction:item:put''enable_max_depth' => true],
  28.         ],
  29.         'delete' => [],
  30.     ],
  31.     collectionOperations: [
  32.         'get' => [
  33.             'normalization_context' => [
  34.                 'groups' => ['docking_restriction:collection:get''createdAt'],
  35.                 'enable_max_depth' => true,
  36.             ],
  37.         ],
  38.         'post' => [
  39.             'normalization_context' => ['groups' => 'docking_restriction:collection:post''enable_max_depth' => true],
  40.             'denormalization_context' => [
  41.                 'groups' => 'docking_restriction:collection:post',
  42.                 'enable_max_depth' => true,
  43.             ],
  44.         ],
  45.     ],
  46. )]
  47. class DockingRestriction
  48. {
  49.     use TimestampableEntity;
  50.     
  51.     #[ORM\Id]
  52.     #[ORM\GeneratedValue(strategy'NONE')]
  53.     #[ORM\Column(type'uuid'uniquetrue)]
  54.     #[ApiProperty(iri'https://schema.org/identifier')]
  55.     #[Groups(['docking_restriction:item:get''docking_restriction:item:put''docking_restriction:collection:get''docking_restriction:collection:post'])]
  56.     private ?int $id null;
  57.     #[ORM\Column(type'integer'nullabletrue)]
  58.     #[ApiProperty(iri'https://schema.org/dwt')]
  59.     #[Assert\GreaterThanOrEqual(0)]
  60.     #[Groups(['docking_restriction:item:get''docking_restriction:item:put''docking_restriction:collection:get''docking_restriction:collection:post'])]
  61.     private ?int $dwt null;
  62.     #[ORM\Column(type'integer'nullabletrue)]
  63.     #[ApiProperty(iri'https://schema.org/loa')]
  64.     #[Assert\GreaterThanOrEqual(0)]
  65.     #[Groups(['docking_restriction:item:get''docking_restriction:item:put''docking_restriction:collection:get''docking_restriction:collection:post'])]
  66.     private ?int $loa null;
  67.     public function __construct()
  68.     {
  69.         $this->id Uuid::uuid4();
  70.     }
  71.     public function getId(): ?UuidInterface
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function setDwt(?int $dwt): void
  76.     {
  77.         $this->dwt $dwt;
  78.     }
  79.     public function getDwt(): ?int
  80.     {
  81.         return $this->dwt;
  82.     }
  83.     public function setLoa(?int $loa): void
  84.     {
  85.         $this->loa $loa;
  86.     }
  87.     public function getLoa(): ?int
  88.     {
  89.         return $this->loa;
  90.     }
  91. }