Hi Alexandr, Why does that have to be done at DQL level, and not at entity level? strtoupper() can be applied directly in the `getTitle` method. Is there any stronger reason for allowing this sort of API (DQL hints) to work in base repositories?
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 20 January 2016 at 06:14, Alexandr Viniychuk <[email protected]> wrote: > Hi everybody, > > I've created a custom SqlWalker and was really disappointed that it works > only for DQL, but not for the repository queries. > Let's say this walker changes SELECT s0_.title as title FROM story s0_ > WHERE id=1 to SELECT UPPER(s0_.title) as title FROM story s0_ WHERE > id=1 > > Imagine that you have a Story entity with only id and title fields. And > you have "A Little Story" with id = 1 in your database. > So when I do request like: > $objects = > $doctrine->getEntityManager()->createQueryBuilder()->from('AppBundle:Story', > 's') > ->select('t')->where('s.id = 1')->getQuery()->execute; > dump($objects[0]->getTitle()); > I see "A LITTLE STORY". > > But when I do: > $object = $doctrine->getRepository('AppBundle:TimeEntry')->find('23'); > dump($object->getTitle()); > > I see "A Little Story", and my worker doesn't work (because of > architecture of BasicEntityPersister). > Is there a way to achieve this result without overriding the Doctrine core > classes? > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
