feat: add tld properties

This commit is contained in:
Maël Gangloff
2024-07-19 18:59:21 +02:00
parent 08e13e73c4
commit 300e68e3a1
11 changed files with 382 additions and 96 deletions

View File

@@ -10,9 +10,6 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RdapServerRepository::class)]
class RdapServer
{
#[ORM\Id]
#[ORM\Column(length: 63)]
private ?string $tld = null;
#[ORM\Id]
#[ORM\Column(length: 255)]
@@ -21,23 +18,17 @@ class RdapServer
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?DateTimeImmutable $updatedAt = null;
#[ORM\Id]
#[ORM\ManyToOne(inversedBy: 'rdapServers')]
#[ORM\JoinColumn(referencedColumnName: 'tld', nullable: false)]
private ?Tld $tld = null;
public function __construct()
{
$this->updatedAt = new DateTimeImmutable('now');
}
public function getTld(): ?string
{
return $this->tld;
}
public function setTld(string $tld): static
{
$this->tld = $tld;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
@@ -68,4 +59,16 @@ class RdapServer
{
$this->setUpdatedAt(new DateTimeImmutable('now'));
}
public function getTld(): ?Tld
{
return $this->tld;
}
public function setTld(?Tld $tld): static
{
$this->tld = $tld;
return $this;
}
}