How should I go about ordering by a discriminator column in a doctrine repository query?
I have a pretty straight forward setup, I have different types of payment detai
Can your try to use TYPE()
or INSTANCE OF
?
related: https://groups.google.com/forum/#!topic/doctrine-user/JtCbwuN-37o
However, this topic doesn't say if it is implemented or not. At the time it was written someone said order by wouldn't work.
$dql = 'SELECT pd
from
AccountingBundle:PaymentDetail pd
JOIN ClientProductBundle:ClientProduct cp
WITH cp.payment_detail_id = pd.id
WHERE
cp.payment_detail_id = pd.id
and cp.client_contact_id = :client_contact_id
GROUP BY pd.id
ORDER BY TYPE(pd)';