Merge remote-tracking branch 'origin/master' into issue383_referent_in_acc_course

This commit is contained in:
2022-01-24 15:04:55 +01:00
173 changed files with 7405 additions and 567 deletions

View File

@@ -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;