diff --git a/migrations/Version20241228180950.php b/migrations/Version20241228180950.php new file mode 100644 index 0000000..2256892 --- /dev/null +++ b/migrations/Version20241228180950.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE entity ADD remarks JSONB DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE entity DROP remarks'); + } +} diff --git a/src/Entity/Entity.php b/src/Entity/Entity.php index 2922499..a819a24 100644 --- a/src/Entity/Entity.php +++ b/src/Entity/Entity.php @@ -69,6 +69,10 @@ class Entity #[Groups(['entity:item', 'domain:item'])] private array $jCard = []; + #[ORM\Column(nullable: true)] + #[Groups(['entity:item', 'domain:item'])] + private ?array $remarks = null; + public function __construct() { $this->domainEntities = new ArrayCollection(); @@ -189,4 +193,16 @@ public function setJCard(array $jCard): static return $this; } + + public function getRemarks(): ?array + { + return $this->remarks; + } + + public function setRemarks(?array $remarks): static + { + $this->remarks = $remarks; + + return $this; + } } diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 8e9a25a..aa896c5 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -509,6 +509,10 @@ private function registerEntity(array $rdapEntity, array $roles, string $domain) $entity->setHandle($rdapEntity['handle']); + if (array_key_exists('remarks', $rdapEntity) && is_array($rdapEntity['remarks'])) { + $entity->setRemarks($rdapEntity['remarks']); + } + if (array_key_exists('vcardArray', $rdapEntity) && !in_array($rdapEntity['handle'], self::IANA_RESERVED_IDS)) { if (empty($entity->getJCard())) { $entity->setJCard($rdapEntity['vcardArray']);