1
$this->get('bundle_name.entity_name.service')->findBy(array(), array('name' => 'ASC'));

This gives the following result when displaying the names:
A
B
C
b

How can I order the result case insensitive? So that the result would be like this when displaying the names:
A
b
B
C

MHarteveld
  • 167
  • 2
  • 8
  • possible duplicate of [Doctrine2 case-sensitive query](http://stackoverflow.com/questions/12129571/doctrine2-case-sensitive-query) – BENARD Patrick Apr 29 '15 at 09:03

1 Answers1

0

Your service looks like a repository. But your data layout doesn't have to do that.

So your best solution is to overide your findBy method and add a natcasesort() to reorder your entities.

Sort array items in PHP so that it is not case sensitive to letters

Community
  • 1
  • 1
Vincent Barrault
  • 2,906
  • 1
  • 19
  • 17