How to order entities by case-insensitive string using API Platform?

82 Views Asked by At

I am using API Platform 3.0. In my application, I have an entity that includes a 'title' field. I'm looking to sort the entities by this 'title' field in a case-insensitive manner.

I currently have the following annotation in my entity:

#[ORM\Entity]
#[ApiResource(
    order: ['title' => 'ASC'],
)]
#[GetCollection]
class MyEntity
{
    #[ORM\Column(type: 'string')]
    public string $title;
}
0

There are 0 best solutions below