2024-07-10 23:30:59 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Entity;
|
|
|
|
|
|
2024-07-11 13:15:04 +02:00
|
|
|
use App\Config\DomainRole;
|
2024-07-10 23:30:59 +02:00
|
|
|
use App\Repository\DomainEntityRepository;
|
2024-07-11 00:29:37 +02:00
|
|
|
use Doctrine\DBAL\Types\Types;
|
2024-07-10 23:30:59 +02:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
2024-07-17 00:19:27 +02:00
|
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
2024-07-10 23:30:59 +02:00
|
|
|
|
|
|
|
|
#[ORM\Entity(repositoryClass: DomainEntityRepository::class)]
|
|
|
|
|
class DomainEntity
|
|
|
|
|
{
|
|
|
|
|
#[ORM\Id]
|
2024-07-12 00:50:30 +02:00
|
|
|
#[ORM\ManyToOne(targetEntity: Domain::class, cascade: ['persist'], inversedBy: 'domainEntities')]
|
2024-07-13 12:49:11 +02:00
|
|
|
#[ORM\JoinColumn(referencedColumnName: 'ldh_name', nullable: false)]
|
2024-07-17 00:19:27 +02:00
|
|
|
#[Groups('domain-entity:domain')]
|
2024-07-10 23:30:59 +02:00
|
|
|
private ?Domain $domain = null;
|
|
|
|
|
|
2024-07-10 23:58:59 +02:00
|
|
|
#[ORM\Id]
|
2024-07-12 00:50:30 +02:00
|
|
|
#[ORM\ManyToOne(targetEntity: Entity::class, cascade: ['persist'], inversedBy: 'domainEntities')]
|
2025-02-18 01:29:29 +01:00
|
|
|
#[ORM\JoinColumn(name: 'entity_uid', referencedColumnName: 'id', nullable: false)]
|
2024-07-17 00:19:27 +02:00
|
|
|
#[Groups(['domain-entity:entity'])]
|
2024-07-10 23:30:59 +02:00
|
|
|
private ?Entity $entity = null;
|
|
|
|
|
|
2025-10-16 22:21:08 +02:00
|
|
|
#[ORM\Column(type: Types::JSON)]
|
2024-07-17 00:19:27 +02:00
|
|
|
#[Groups(['domain-entity:entity', 'domain-entity:domain'])]
|
2024-07-11 00:29:37 +02:00
|
|
|
private array $roles = [];
|
2024-07-10 23:30:59 +02:00
|
|
|
|
2025-09-15 23:51:57 +02:00
|
|
|
#[ORM\Column(nullable: true)]
|
2024-08-06 19:05:02 +02:00
|
|
|
#[Groups(['domain-entity:entity', 'domain-entity:domain'])]
|
2025-09-15 23:51:57 +02:00
|
|
|
private ?\DateTimeImmutable $deletedAt = null;
|
2024-08-06 19:05:02 +02:00
|
|
|
|
2024-07-10 23:30:59 +02:00
|
|
|
public function getDomain(): ?Domain
|
|
|
|
|
{
|
|
|
|
|
return $this->domain;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setDomain(?Domain $domain): static
|
|
|
|
|
{
|
|
|
|
|
$this->domain = $domain;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getEntity(): ?Entity
|
|
|
|
|
{
|
|
|
|
|
return $this->entity;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setEntity(?Entity $entity): static
|
|
|
|
|
{
|
|
|
|
|
$this->entity = $entity;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 13:15:04 +02:00
|
|
|
/**
|
|
|
|
|
* @return DomainRole[]
|
|
|
|
|
*/
|
|
|
|
|
public function getRoles(): array
|
2024-07-10 23:30:59 +02:00
|
|
|
{
|
|
|
|
|
return $this->roles;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 00:29:37 +02:00
|
|
|
public function setRoles(array $roles): static
|
2024-07-10 23:30:59 +02:00
|
|
|
{
|
|
|
|
|
$this->roles = $roles;
|
|
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2024-08-06 19:05:02 +02:00
|
|
|
|
2025-09-15 23:51:57 +02:00
|
|
|
public function getDeletedAt(): ?\DateTimeImmutable
|
2024-08-06 19:05:02 +02:00
|
|
|
{
|
2025-09-15 23:51:57 +02:00
|
|
|
return $this->deletedAt;
|
2024-08-06 19:05:02 +02:00
|
|
|
}
|
|
|
|
|
|
2025-09-15 23:51:57 +02:00
|
|
|
public function setDeletedAt(?\DateTimeImmutable $deletedAt): static
|
2024-08-06 19:05:02 +02:00
|
|
|
{
|
2025-09-15 23:51:57 +02:00
|
|
|
$this->deletedAt = $deletedAt;
|
2024-08-06 19:05:02 +02:00
|
|
|
|
|
|
|
|
return $this;
|
|
|
|
|
}
|
2024-07-10 23:30:59 +02:00
|
|
|
}
|