mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
Merge branch 'master' into feat/rss-feed
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
namespace App\Entity;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use App\Repository\EntityRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\ORM\Mapping\Embedded;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
use Symfony\Component\Serializer\Attribute\SerializedName;
|
||||
|
||||
@@ -86,11 +86,16 @@ class Entity
|
||||
#[Groups(['entity:item', 'domain:item'])]
|
||||
private ?array $remarks = null;
|
||||
|
||||
#[Embedded(class: IanaAccreditation::class, columnPrefix: 'iana_')]
|
||||
#[Groups(['entity:item', 'domain:item'])]
|
||||
private IanaAccreditation $ianaAccreditation;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->domainEntities = new ArrayCollection();
|
||||
$this->nameserverEntities = new ArrayCollection();
|
||||
$this->events = new ArrayCollection();
|
||||
$this->ianaAccreditation = new IanaAccreditation();
|
||||
}
|
||||
|
||||
public function getHandle(): ?string
|
||||
@@ -242,4 +247,14 @@ class Entity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIanaAccreditation(): IanaAccreditation
|
||||
{
|
||||
return $this->ianaAccreditation;
|
||||
}
|
||||
|
||||
public function setIanaAccreditation(IanaAccreditation $ianaAccreditation): void
|
||||
{
|
||||
$this->ianaAccreditation = $ianaAccreditation;
|
||||
}
|
||||
}
|
||||
|
||||
93
src/Entity/IanaAccreditation.php
Normal file
93
src/Entity/IanaAccreditation.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
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
|
||||
{
|
||||
return $this->registrarName;
|
||||
}
|
||||
|
||||
public function setRegistrarName(?string $registrarName): static
|
||||
{
|
||||
$this->registrarName = $registrarName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRdapBaseUrl(): ?string
|
||||
{
|
||||
return $this->rdapBaseUrl;
|
||||
}
|
||||
|
||||
public function setRdapBaseUrl(?string $rdapBaseUrl): static
|
||||
{
|
||||
$this->rdapBaseUrl = $rdapBaseUrl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatus(): ?RegistrarStatus
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(?RegistrarStatus $status): static
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUpdated(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
public function setUpdated(?\DateTimeImmutable $updated): static
|
||||
{
|
||||
$this->updated = $updated;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDate(): ?\DateTimeImmutable
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(?\DateTimeImmutable $date): static
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -115,12 +115,15 @@ class Tld
|
||||
|
||||
public function getTld(): ?string
|
||||
{
|
||||
return '' === $this->tld ? '.' : $this->tld;
|
||||
return $this->tld;
|
||||
}
|
||||
|
||||
public function setTld(string $tld): static
|
||||
{
|
||||
$this->tld = RDAPService::convertToIdn($tld);
|
||||
if ('' === $this->tld) {
|
||||
$this->tld = '.';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user