mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
send system notification on period confirmation
This commit is contained in:
@@ -74,9 +74,14 @@ class Notification implements TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private User $sender;
|
||||
private ?User $sender = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", options={"default": ""})
|
||||
*/
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=User::class)
|
||||
@@ -179,6 +184,11 @@ class Notification implements TrackUpdateInterface
|
||||
return $this->sender;
|
||||
}
|
||||
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getUnreadBy(): Collection
|
||||
{
|
||||
return $this->unreadBy;
|
||||
@@ -199,6 +209,11 @@ class Notification implements TrackUpdateInterface
|
||||
return !$this->unreadBy->contains($user);
|
||||
}
|
||||
|
||||
public function isSystem(): bool
|
||||
{
|
||||
return null === $this->sender;
|
||||
}
|
||||
|
||||
public function markAsReadBy(User $user): self
|
||||
{
|
||||
return $this->removeUnreadBy($user);
|
||||
@@ -299,6 +314,13 @@ class Notification implements TrackUpdateInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTitle(string $title): Notification
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(DateTimeInterface $datetime): self
|
||||
{
|
||||
$this->updatedAt = $datetime;
|
||||
|
Reference in New Issue
Block a user