'Notification', 'tips' => 'Tips', ])] class AbstractInformation { #[ORM\Id] #[ORM\Column] #[ORM\GeneratedValue] protected ?int $id = null; #[ORM\ManyToOne(inversedBy: 'notifications')] #[ORM\JoinColumn(nullable: false)] protected ?Access $recipientAccess; #[ORM\ManyToOne(inversedBy: 'notifications')] #[ORM\JoinColumn(nullable: false)] protected ?Organization $recipientOrganization; #[ORM\Column(length: 40, nullable: true)] protected ?string $name = null; #[ORM\Column(type: 'datetime', nullable: true)] protected ?\DateTimeInterface $createDate; #[ORM\Column(type: 'datetime', nullable: true)] protected ?\DateTimeInterface $updateDate; #[ORM\Column(type: 'json', length: 4294967295, nullable: true)] protected mixed $message = []; #[ORM\Column(length: 50, nullable: true, enumType: NotificationTypeEnum::class)] protected ?NotificationTypeEnum $type = null; #[ORM\Column(length: 255, nullable: true)] protected ?string $link = null; #[ORM\Column(type: 'date', nullable: true)] #[Context(normalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'Y-m-d'])] protected ?\DateTimeInterface $availabilityDate = null; #[ORM\OneToMany(mappedBy: 'notification', targetEntity: NotificationUser::class, cascade: ['persist'], orphanRemoval: true)] protected Collection $notificationUsers; #[Pure] public function __construct() { $this->notificationUsers = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getName(): ?string { return $this->name; } public function setRecipientAccess(?Access $recipientAccess): self { $this->recipientAccess = $recipientAccess; return $this; } public function getRecipientAccess(): ?Access { return $this->recipientAccess; } public function getRecipientOrganization(): ?Organization { return $this->recipientOrganization; } public function setRecipientOrganization(?Organization $recipientOrganization): self { $this->recipientOrganization = $recipientOrganization; return $this; } public function getCreateDate(): ?\DateTimeInterface { return $this->createDate; } public function setCreateDate(?\DateTimeInterface $createDate): self { $this->createDate = $createDate; return $this; } public function getUpdateDate(): ?\DateTimeInterface { return $this->updateDate; } public function setUpdateDate(?\DateTimeInterface $updateDate): self { $this->updateDate = $updateDate; return $this; } public function setMessage(mixed $message): self { $this->message = $message; return $this; } public function getMessage(): mixed { if (!is_array($this->message)) { return ['about' => $this->message]; } return $this->message; } public function setType(?NotificationTypeEnum $type): self { $this->type = $type; return $this; } public function getType(): ?NotificationTypeEnum { return $this->type; } public function setLink(?string $link): self { $this->link = $link; return $this; } public function getLink(): ?string { return $this->link; } public function getAvailabilityDate(): ?\DateTimeInterface { return $this->availabilityDate; } public function setAvailabilityDate(?\DateTime $availabilityDate = null): self { if ($availabilityDate == null) { $availabilityDate = new \DateTime(); } $this->availabilityDate = $availabilityDate; return $this; } public function getNotificationUsers(): Collection { return $this->notificationUsers; } public function addNotificationUser(NotificationUser $notificationUsers): self { if (!$this->notificationUsers->contains($notificationUsers)) { $this->notificationUsers[] = $notificationUsers; $notificationUsers->setNotification($this); } return $this; } public function removeNotificationUser(NotificationUser $notificationUsers): self { if ($this->notificationUsers->removeElement($notificationUsers)) { // set the owning side to null (unless already changed) if ($notificationUsers->getNotification() === $this) { $notificationUsers->setNotification(null); } } return $this; } }