You can't use the criteria API for this sort of complex conditionals... You will likely need to fetch + sort or rely on a custom repository method.
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 17 September 2014 16:54, Brandon A. Olivares <[email protected]> wrote: > Hello, > > I have an entity with a collection of entities. The collection needs to be > sorted by a field in a sub-entity of that collection. I'm trying to use > Criteria, but it seems to not support fields in child entities. > > What would be my best option? Unfortunately I can't use DQL here. It is a > Symfony form with a collection field type, and I cannot specify a query, so > it has to be ordered on the object level. > > Thanks, > Brandon > > -- > 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 http://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 http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
