|
@@ -6,6 +6,7 @@ namespace App\Entity\Core;
|
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
use App\Entity\Access\Access;
|
|
use App\Entity\Access\Access;
|
|
|
|
|
+use App\Entity\Organization\Organization;
|
|
|
use App\Repository\Core\NotificationRepository;
|
|
use App\Repository\Core\NotificationRepository;
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
@@ -48,9 +49,19 @@ class Notification
|
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
#[ORM\JoinColumn(nullable: false)]
|
|
|
private ?Access $recipientAccess;
|
|
private ?Access $recipientAccess;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\ManyToOne(inversedBy: 'notifications')]
|
|
|
|
|
+ #[ORM\JoinColumn(nullable: false)]
|
|
|
|
|
+ private ?Organization $recipientOrganization;
|
|
|
|
|
+
|
|
|
#[ORM\Column(length: 40, nullable: true)]
|
|
#[ORM\Column(length: 40, nullable: true)]
|
|
|
private ?string $name = null;
|
|
private ?string $name = null;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(type: 'date', nullable: true)]
|
|
|
|
|
+ private ?\DateTimeInterface $createDate;
|
|
|
|
|
+
|
|
|
|
|
+ #[ORM\Column(type: 'date', nullable: true)]
|
|
|
|
|
+ private ?\DateTimeInterface $updateDate;
|
|
|
|
|
+
|
|
|
#[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
|
|
#[ORM\Column(type: 'json', length: 4294967295, nullable: true)]
|
|
|
private mixed $message = [];
|
|
private mixed $message = [];
|
|
|
|
|
|
|
@@ -67,6 +78,10 @@ class Notification
|
|
|
#[ORM\OneToMany(mappedBy: 'notification', targetEntity: NotificationUser::class, cascade: ['persist'], orphanRemoval: true)]
|
|
#[ORM\OneToMany(mappedBy: 'notification', targetEntity: NotificationUser::class, cascade: ['persist'], orphanRemoval: true)]
|
|
|
private Collection $notificationUsers;
|
|
private Collection $notificationUsers;
|
|
|
|
|
|
|
|
|
|
+ // Todo: le champs name sert à qqchose au final?
|
|
|
|
|
+ // Todo: les champs activate, isSystem, legacyId, createdBy, updatedBy, draft, content, priorityLevelEnum, datetimeStart, datetimeEnd et legalStatus sont inutilisés, on les garde ou pas ?
|
|
|
|
|
+ // Todo: j'imagine que le champs tipsAccessFilters ne s'applique pas aux notifs?
|
|
|
|
|
+
|
|
|
#[Pure] public function __construct()
|
|
#[Pure] public function __construct()
|
|
|
{
|
|
{
|
|
|
$this->notificationUsers = new ArrayCollection();
|
|
$this->notificationUsers = new ArrayCollection();
|
|
@@ -99,6 +114,60 @@ class Notification
|
|
|
return $this->recipientAccess;
|
|
return $this->recipientAccess;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return Organization|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getRecipientOrganization(): ?Organization
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->recipientOrganization;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param Organization|null $recipientOrganization
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setRecipientOrganization(?Organization $recipientOrganization): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->recipientOrganization = $recipientOrganization;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return \DateTimeInterface|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getCreateDate(): ?\DateTimeInterface
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->createDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param \DateTimeInterface|null $createDate
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setCreateDate(?\DateTimeInterface $createDate): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->createDate = $createDate;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return \DateTimeInterface|null
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getUpdateDate(): ?\DateTimeInterface
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->updateDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param \DateTimeInterface|null $updateDate
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setUpdateDate(?\DateTimeInterface $updateDate): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->updateDate = $updateDate;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function setMessage(mixed $message): self
|
|
public function setMessage(mixed $message): self
|
|
|
{
|
|
{
|
|
|
$this->message = $message;
|
|
$this->message = $message;
|
|
@@ -171,4 +240,4 @@ class Notification
|
|
|
|
|
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
+}
|