mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
batch replace/rename initialComment by pinnedComment
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user