mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 19:13:49 +00:00
Merge remote-tracking branch 'origin/master' into issue383_referent_in_acc_course
This commit is contained in:
@@ -337,6 +337,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,
|
||||
@@ -770,6 +777,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
|
||||
@@ -883,6 +895,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.
|
||||
*/
|
||||
@@ -1122,6 +1139,9 @@ class AccompanyingPeriod implements
|
||||
}
|
||||
|
||||
if ($comment instanceof Comment) {
|
||||
if (null !== $this->pinnedComment) {
|
||||
$this->addComment($this->pinnedComment);
|
||||
}
|
||||
$this->addComment($comment);
|
||||
}
|
||||
|
||||
@@ -1195,6 +1215,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