Fix use of Ordering constant in doctrine orm association

See https://github.com/doctrine/orm/issues/11313 for a follow-up
This commit is contained in:
2024-04-08 13:09:24 +02:00
parent e8c7623a1e
commit 19ffef156b
4 changed files with 12 additions and 4 deletions

View File

@@ -157,7 +157,7 @@ class AccompanyingPeriod implements
*/
#[Assert\NotBlank(groups: [AccompanyingPeriod::STEP_DRAFT])]
#[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'accompanyingPeriod', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['createdAt' => Order::Descending, 'id' => 'DESC'])]
#[ORM\OrderBy(['createdAt' => Criteria::DESC, 'id' => 'DESC'])]
private Collection $comments;
#[Groups(['read', 'write', 'docgen:read'])]