<?php
// @deprecated
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiProperty;
use App\Trait\TimestampableEntity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\Groups;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
/**
* Represents docking restrictions for vessels.
*
* @see https://schema.org/DockingRestriction
*/
#[ORM\Entity]
#[ApiResource(
iri: 'DockingRestriction',
itemOperations: [
'get' => [
'normalization_context' => ['groups' => 'docking_restriction:item:get', 'enable_max_depth' => true],
],
'put' => [
'normalization_context' => ['groups' => 'docking_restriction:item:put', 'enable_max_depth' => true],
'denormalization_context' => ['groups' => 'docking_restriction:item:put', 'enable_max_depth' => true],
],
'delete' => [],
],
collectionOperations: [
'get' => [
'normalization_context' => [
'groups' => ['docking_restriction:collection:get', 'createdAt'],
'enable_max_depth' => true,
],
],
'post' => [
'normalization_context' => ['groups' => 'docking_restriction:collection:post', 'enable_max_depth' => true],
'denormalization_context' => [
'groups' => 'docking_restriction:collection:post',
'enable_max_depth' => true,
],
],
],
)]
class DockingRestriction
{
use TimestampableEntity;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'NONE')]
#[ORM\Column(type: 'uuid', unique: true)]
#[ApiProperty(iri: 'https://schema.org/identifier')]
#[Groups(['docking_restriction:item:get', 'docking_restriction:item:put', 'docking_restriction:collection:get', 'docking_restriction:collection:post'])]
private ?int $id = null;
#[ORM\Column(type: 'integer', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/dwt')]
#[Assert\GreaterThanOrEqual(0)]
#[Groups(['docking_restriction:item:get', 'docking_restriction:item:put', 'docking_restriction:collection:get', 'docking_restriction:collection:post'])]
private ?int $dwt = null;
#[ORM\Column(type: 'integer', nullable: true)]
#[ApiProperty(iri: 'https://schema.org/loa')]
#[Assert\GreaterThanOrEqual(0)]
#[Groups(['docking_restriction:item:get', 'docking_restriction:item:put', 'docking_restriction:collection:get', 'docking_restriction:collection:post'])]
private ?int $loa = null;
public function __construct()
{
$this->id = Uuid::uuid4();
}
public function getId(): ?UuidInterface
{
return $this->id;
}
public function setDwt(?int $dwt): void
{
$this->dwt = $dwt;
}
public function getDwt(): ?int
{
return $this->dwt;
}
public function setLoa(?int $loa): void
{
$this->loa = $loa;
}
public function getLoa(): ?int
{
return $this->loa;
}
}