feat: add enum

This commit is contained in:
Maël Gangloff
2024-07-11 13:15:04 +02:00
parent fbb14df399
commit f6bd04ba17
11 changed files with 206 additions and 162 deletions

View File

@@ -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;
}
}