feat: update entities to comply with RDAP

This commit is contained in:
Maël Gangloff
2024-07-13 00:22:17 +02:00
parent ab3b6b1170
commit 4b062a6759
12 changed files with 5611 additions and 816 deletions

View File

@@ -31,9 +31,6 @@ class Domain
#[ORM\OneToMany(targetEntity: DomainEntity::class, mappedBy: 'domain', cascade: ['persist'], orphanRemoval: true)]
private Collection $domainEntities;
#[ORM\Column(length: 255)]
private ?string $whoisStatus = null;
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainStatus::class)]
private array $status = [];
@@ -49,7 +46,7 @@ class Domain
#[ORM\ManyToMany(targetEntity: Nameserver::class, inversedBy: 'domains', cascade: ['persist'])]
#[ORM\JoinTable(name: 'domain_nameservers',
joinColumns: [new ORM\JoinColumn(name: 'domain_handle', referencedColumnName: 'handle')],
inverseJoinColumns: [new ORM\JoinColumn(name: 'nameserver_handle', referencedColumnName: 'handle')]
inverseJoinColumns: [new ORM\JoinColumn(name: 'nameserver_ldh_name', referencedColumnName: 'ldh_name')]
)]
private Collection $nameservers;
@@ -68,7 +65,7 @@ class Domain
public function setLdhName(string $ldhName): static
{
$this->ldhName = $ldhName;
$this->ldhName = strtolower($ldhName);
return $this;
}
@@ -145,18 +142,6 @@ class Domain
return $this;
}
public function getWhoisStatus(): ?string
{
return $this->whoisStatus;
}
public function setWhoisStatus(string $whoisStatus): static
{
$this->whoisStatus = $whoisStatus;
return $this;
}
/**
* @return DomainStatus[]
*/

View File

@@ -12,10 +12,8 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: NameserverRepository::class)]
class Nameserver
{
#[ORM\Id]
#[ORM\Column(length: 255)]
private ?string $handle = null;
#[ORM\Id]
#[ORM\Column(length: 255)]
private ?string $ldhName = null;
@@ -25,9 +23,6 @@ class Nameserver
#[ORM\OneToMany(targetEntity: NameserverEntity::class, mappedBy: 'nameserver', cascade: ['persist'], orphanRemoval: true)]
private Collection $nameserverEntities;
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainStatus::class)]
private array $status = [];
/**
* @var Collection<int, Domain>
*/
@@ -40,18 +35,6 @@ class Nameserver
$this->domains = new ArrayCollection();
}
public function getHandle(): ?string
{
return $this->handle;
}
public function setHandle(string $handle): static
{
$this->handle = $handle;
return $this;
}
public function getLdhName(): ?string
{
return $this->ldhName;
@@ -59,7 +42,7 @@ class Nameserver
public function setLdhName(string $ldhName): static
{
$this->ldhName = $ldhName;
$this->ldhName = strtolower($ldhName);
return $this;
}
@@ -94,21 +77,6 @@ class Nameserver
return $this;
}
/**
* @return DomainStatus[]
*/
public function getStatus(): array
{
return $this->status;
}
public function setStatus(array $status): static
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, Domain>
*/

View File

@@ -13,7 +13,7 @@ class NameserverEntity
{
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Nameserver::class, cascade: ['persist'], inversedBy: 'nameserverEntities')]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
#[ORM\JoinColumn(referencedColumnName: 'ldh_name', nullable: false)]
private ?Nameserver $nameserver = null;
#[ORM\Id]