mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add enum
This commit is contained in:
18
src/Config/DomainRole.php
Normal file
18
src/Config/DomainRole.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
enum DomainRole: string
|
||||
{
|
||||
case Registrant = 'registrant';
|
||||
case Technical = 'technical';
|
||||
case Administrative = 'administrative';
|
||||
case Abuse = 'abuse';
|
||||
case Billing = 'billing';
|
||||
case Registrar = 'registrar';
|
||||
case Reseller = 'reseller';
|
||||
case Sponsor = 'sponsor';
|
||||
case Proxy = 'proxy';
|
||||
case Notifications = 'notifications';
|
||||
case Noc = 'noc';
|
||||
}
|
||||
43
src/Config/DomainStatus.php
Normal file
43
src/Config/DomainStatus.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
enum DomainStatus: string
|
||||
{
|
||||
case Validated = 'validated';
|
||||
case RenewProhibited = 'renew prohibited';
|
||||
case UpdateProhibited = 'update prohibited';
|
||||
case TransferProhibited = 'transfer prohibited';
|
||||
case DeleteProhibited = 'delete prohibited';
|
||||
case Proxy = 'proxy';
|
||||
case Private = 'private';
|
||||
case Removed = 'removed';
|
||||
case Obscured = 'obscured';
|
||||
case Associated = 'associated';
|
||||
case Active = 'active';
|
||||
case Inactive = 'inactive';
|
||||
case Locked = 'locked';
|
||||
case PendingCreate = 'pending create';
|
||||
case PendingRenew = 'pending renew';
|
||||
case PendingTransfer = 'pending transfer';
|
||||
case PendingUpdate = 'pending update';
|
||||
case PendingDelete = 'pending delete';
|
||||
case AddPeriod = 'add period';
|
||||
case AutoRenewPeriod = 'auto renew period';
|
||||
case ClientDeleteProhibited = 'client delete prohibited';
|
||||
case ClientHold = 'client hold';
|
||||
case ClientRenewProhibited = 'client renew prohibited';
|
||||
case ClientTransferProhibited = 'client transfer prohibited';
|
||||
case ClientUpdateProhibited = 'client update prohibited';
|
||||
case PendingRestore = 'pending restore';
|
||||
case RedemptionPeriod = 'redemption period';
|
||||
case RenewPeriod = 'renew period';
|
||||
case ServerDeleteProhibited = 'server delete prohibited';
|
||||
case ServerRenewProhibited = 'server renew prohibited';
|
||||
case ServerTransferProhibited = 'server transfer prohibited';
|
||||
case ServerUpdateProhibited = 'server update prohibited';
|
||||
case ServerHold = 'server hold';
|
||||
case TransferPeriod = 'transfer period';
|
||||
case Administrative = 'administrative';
|
||||
case Reserved = 'reserved';
|
||||
}
|
||||
12
src/Config/DomainVariantRelation.php
Normal file
12
src/Config/DomainVariantRelation.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
enum DomainVariantRelation: string
|
||||
{
|
||||
case Registered = 'registered';
|
||||
case Unregistered = 'unregistered';
|
||||
case RegistrationRestricted = 'registration restricted';
|
||||
case OpenRegistration = 'open registration';
|
||||
case Conjoined = 'conjoined';
|
||||
}
|
||||
19
src/Config/EventAction.php
Normal file
19
src/Config/EventAction.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
enum EventAction: string
|
||||
{
|
||||
case Registration = 'registration';
|
||||
case Reregistration = 'reregistration';
|
||||
case LastChanged = 'last changed';
|
||||
case Expiration = 'expiration';
|
||||
case Deletion = 'deletion';
|
||||
case Reinstantiation = 'reinstantiation';
|
||||
case Transfer = 'transfer';
|
||||
case Locked = 'locked';
|
||||
case Unlocked = 'unlocked';
|
||||
case LastUpdateOfRDAPDatabase = 'last update of RDAP database';
|
||||
case RegistrarExpiration = 'registrar expiration';
|
||||
case EnumValidationExpiration = 'enum validation expiration';
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Config\DomainStatus;
|
||||
use App\Repository\DomainRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -18,9 +19,6 @@ class Domain
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $handle = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
|
||||
private array $status = [];
|
||||
|
||||
/**
|
||||
* @var Collection<int, Event>
|
||||
*/
|
||||
@@ -36,6 +34,9 @@ class Domain
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $whoisStatus = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainStatus::class)]
|
||||
private array $status = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->events = new ArrayCollection();
|
||||
@@ -66,18 +67,6 @@ class Domain
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatus(): array
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(array $status): static
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Event>
|
||||
*/
|
||||
@@ -149,4 +138,19 @@ class Domain
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DomainStatus[]
|
||||
*/
|
||||
public function getStatus(): array
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(array $status): static
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Config\DomainRole;
|
||||
use App\Repository\DomainEntityRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -19,9 +20,10 @@ class DomainEntity
|
||||
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
||||
private ?Entity $entity = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainRole::class)]
|
||||
private array $roles = [];
|
||||
|
||||
|
||||
public function getDomain(): ?Domain
|
||||
{
|
||||
return $this->domain;
|
||||
@@ -46,7 +48,10 @@ class DomainEntity
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRoles(): ?array
|
||||
/**
|
||||
* @return DomainRole[]
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
@@ -57,4 +62,5 @@ class DomainEntity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Config\DomainStatus;
|
||||
use App\Repository\NameserverRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -24,7 +25,7 @@ class Nameserver
|
||||
#[ORM\OneToMany(targetEntity: NameserverEntity::class, mappedBy: 'nameserver', orphanRemoval: true)]
|
||||
private Collection $nameserverEntities;
|
||||
|
||||
#[ORM\Column(type: Types::ARRAY)]
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainStatus::class)]
|
||||
private array $status = [];
|
||||
|
||||
public function __construct()
|
||||
@@ -86,6 +87,9 @@ class Nameserver
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DomainStatus[]
|
||||
*/
|
||||
public function getStatus(): array
|
||||
{
|
||||
return $this->status;
|
||||
@@ -97,4 +101,5 @@ class Nameserver
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Config\DomainRole;
|
||||
use App\Config\DomainStatus;
|
||||
use App\Repository\NameserverEntityRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -19,10 +21,10 @@ class NameserverEntity
|
||||
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
||||
private ?Entity $entity = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainRole::class)]
|
||||
private array $roles = [];
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY)]
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainStatus::class)]
|
||||
private array $status = [];
|
||||
|
||||
public function getNameserver(): ?Nameserver
|
||||
@@ -49,6 +51,9 @@ class NameserverEntity
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DomainRole[]
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
return $this->roles;
|
||||
@@ -61,6 +66,9 @@ class NameserverEntity
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DomainStatus[]
|
||||
*/
|
||||
public function getStatus(): array
|
||||
{
|
||||
return $this->status;
|
||||
@@ -72,4 +80,5 @@ class NameserverEntity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user