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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user