mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Improve notifications
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user