batch replace/rename initialComment by pinnedComment

This commit is contained in:
2021-12-13 16:31:16 +01:00
parent 52a137ee77
commit f8071d32c0
7 changed files with 72 additions and 34 deletions

View File

@@ -186,7 +186,7 @@ class AccompanyingPeriod implements
* )
* @Groups({"read"})
*/
private ?Comment $initialComment = null;
private ?Comment $pinnedComment = null;
/**
* @var string
@@ -563,7 +563,7 @@ class AccompanyingPeriod implements
public function getComments(): Collection
{
return $this->comments->filter(function (Comment $c) {
return $c !== $this->initialComment;
return $c !== $this->pinnedComment;
});
}
@@ -606,9 +606,9 @@ class AccompanyingPeriod implements
/**
* @Groups({"read"})
*/
public function getInitialComment(): ?Comment
public function getPinnedComment(): ?Comment
{
return $this->initialComment;
return $this->pinnedComment;
}
public function getIntensity(): ?string
@@ -1030,17 +1030,17 @@ class AccompanyingPeriod implements
/**
* @Groups({"write"})
*/
public function setInitialComment(?Comment $comment = null): self
public function setPinnedComment(?Comment $comment = null): self
{
if (null !== $this->initialComment) {
$this->removeComment($this->initialComment);
if (null !== $this->pinnedComment) {
$this->removeComment($this->pinnedComment);
}
if ($comment instanceof Comment) {
$this->addComment($comment);
}
$this->initialComment = $comment;
$this->pinnedComment = $comment;
return $this;
}