Fixed: Accompanyingperiod / comment: order by newest to oldest

This commit is contained in:
Julien Fastré 2023-06-21 13:33:29 +02:00
parent 45724100d4
commit 146103e87c
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: '[Accompanying period comments]: order comments from the most recent to the
oldest, in the list'
time: 2023-06-21T13:28:51.282714011+02:00
custom:
Issue: ""

View File

@ -185,7 +185,9 @@ class AccompanyingPeriod implements
* cascade={"persist", "remove"}, * cascade={"persist", "remove"},
* orphanRemoval=true * orphanRemoval=true
* ) * )
* @ORM\OrderBy({"createdAt": "DESC", "id": "DESC"})
* @Assert\NotBlank(groups={AccompanyingPeriod::STEP_DRAFT}) * @Assert\NotBlank(groups={AccompanyingPeriod::STEP_DRAFT})
* @var Collection<Comment>
*/ */
private Collection $comments; private Collection $comments;
@ -705,10 +707,11 @@ class AccompanyingPeriod implements
->comments ->comments
->filter( ->filter(
static fn (Comment $c): bool => $c !== $pinnedComment static fn (Comment $c): bool => $c !== $pinnedComment
); )
;
} }
public function getCreatedAt(): ?DateTime public function getCreatedAt(): DateTimeInterface
{ {
return $this->createdAt; return $this->createdAt;
} }