content; } public function getCreatedAt(): ?DateTimeImmutable { return $this->createdAt; } public function getCreatedBy(): ?User { return $this->createdBy; } public function getId(): ?int { return $this->id; } public function getNotification(): ?Notification { return $this->notification; } public function getUpdatedAt(): ?DateTimeImmutable { return $this->updateAt; } public function getUpdatedBy(): ?User { return $this->updatedBy; } /** * @ORM\PreFlush */ public function onFlushMarkNotificationAsUnread(PreFlushEventArgs $eventArgs): void { if ($this->recentlyPersisted) { foreach ($this->getNotification()->getAddressees() as $addressee) { if ($this->getCreatedBy() !== $addressee) { $this->getNotification()->markAsUnreadBy($addressee); } } if ($this->getNotification()->getSender() !== $this->getCreatedBy()) { $this->getNotification()->markAsUnreadBy($this->getNotification()->getSender()); } } } /** * @ORM\PrePersist */ public function onPrePersist(LifecycleEventArgs $eventArgs): void { $this->recentlyPersisted = true; } public function setContent(?string $content): self { $this->content = (string) $content; return $this; } public function setCreatedAt(DateTimeInterface $datetime): self { $this->createdAt = $datetime; return $this; } public function setCreatedBy(User $user): self { $this->createdBy = $user; return $this; } /** * @internal use Notification::addComment */ public function setNotification(?Notification $notification): self { $this->notification = $notification; return $this; } /** * @deprecated use @see{self::setUpdatedAt} instead */ public function setUpdateAt(?DateTimeImmutable $updateAt): self { return $this->setUpdatedAt($updateAt); } public function setUpdatedAt(DateTimeInterface $datetime): self { $this->updateAt = $datetime; return $this; } public function setUpdatedBy(User $user): self { $this->updatedBy = $user; return $this; } }