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