これは役立つかもしれません:
$qb = $em->createQueryBuilder();
$qb->select('Entity, COALESCE(Entity.column1, Entity.column2) as columnOrder')
->from('Namespace\EntityName', 'Entity')
->addOrderBy('columnOrder', 'ASC')
->getQuery()
->execute();
これは役立つかもしれません:
$qb = $em->createQueryBuilder();
$qb->select('Entity, COALESCE(Entity.column1, Entity.column2) as columnOrder')
->from('Namespace\EntityName', 'Entity')
->addOrderBy('columnOrder', 'ASC')
->getQuery()
->execute();