Improve notifications

This commit is contained in:
2022-01-24 10:09:57 +00:00
parent ad05b3bf05
commit 54c2b92962
26 changed files with 385 additions and 97 deletions

View File

@@ -327,6 +327,13 @@ class AccompanyingPeriod implements
*/
private ?User $user = null;
/**
* Temporary field, which is filled when the user is changed.
*
* Used internally for listener when user change
*/
private ?User $userPrevious = null;
/**
* @ORM\OneToMany(
* targetEntity=AccompanyingPeriodWork::class,
@@ -755,6 +762,11 @@ class AccompanyingPeriod implements
return $this->pinnedComment;
}
public function getPreviousUser(): ?User
{
return $this->userPrevious;
}
/**
* @return Collection|SocialAction[] All the descendant social actions of all
* the descendants of the entity
@@ -868,6 +880,11 @@ class AccompanyingPeriod implements
return $this->works;
}
public function hasPreviousUser(): bool
{
return null !== $this->userPrevious;
}
/**
* Returns true if the closing date is after the opening date.
*/
@@ -1172,6 +1189,10 @@ class AccompanyingPeriod implements
public function setUser(User $user): self
{
if ($this->user !== $user) {
$this->userPrevious = $this->user;
}
$this->user = $user;
return $this;