feat: add groups on properties

This commit is contained in:
Maël Gangloff
2025-09-10 22:26:02 +02:00
parent acc3a4550a
commit a995866c3e
3 changed files with 21 additions and 18 deletions

View File

@@ -6,23 +6,29 @@ use App\Config\RegistrarStatus;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Embeddable;
use Symfony\Component\Serializer\Attribute\Groups;
#[Embeddable]
class IanaAccreditation
{
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['entity:item', 'domain:item'])]
private ?string $registrarName = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['entity:item', 'domain:item'])]
private ?string $rdapBaseUrl = null;
#[ORM\Column(nullable: true, enumType: RegistrarStatus::class)]
#[Groups(['entity:item', 'domain:item'])]
private ?RegistrarStatus $status = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
#[Groups(['entity:item', 'domain:item'])]
private ?\DateTimeImmutable $updated = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
#[Groups(['entity:item', 'domain:item'])]
private ?\DateTimeImmutable $date = null;
public function getRegistrarName(): ?string