mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: a domain may not have status
This commit is contained in:
@@ -71,7 +71,7 @@ class Domain
|
||||
#[SerializedName('entities')]
|
||||
private Collection $domainEntities;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
private array $status = [];
|
||||
|
||||
|
||||
@@ -87,11 +87,9 @@ readonly class RDAPService
|
||||
$domain = $this->domainRepository->findOneBy(["ldhName" => strtolower($res['ldhName'])]);
|
||||
if ($domain === null) $domain = new Domain();
|
||||
|
||||
$domain
|
||||
->setTld($tld)
|
||||
->setLdhName($res['ldhName'])
|
||||
->setStatus($res['status']);
|
||||
$domain->setTld($tld)->setLdhName($res['ldhName']);
|
||||
|
||||
if (array_key_exists('status', $res)) $domain->setStatus($res['status']);
|
||||
if (array_key_exists('handle', $res)) $domain->setHandle($res['handle']);
|
||||
|
||||
$this->em->persist($domain);
|
||||
|
||||
Reference in New Issue
Block a user