Open jkgroupe opened 4 years ago
Hi,
I have an issue when I select tags in a specific order, the entities result is reordered by id and not by the specific selection
Values order [5,2,3,1,4]
[5,2,3,1,4]
Result from transformer [1,2,3,4,5]
[1,2,3,4,5]
To resolve this issue with beberlei/DoctrineExtensions package
// get multiple entities with one query $entities = $this->em->createQueryBuilder() ->select('entity') ->from($this->className, 'entity') ->where('entity.' . $this->primaryKey . ' IN (:ids)') ->setParameter('ids', $values) ->orderBy('FIELD(entity.' . $this->primaryKey . ', :ids)') // Ordering by ids ->getQuery() ->getResult();
Thanks
Hi,
I have an issue when I select tags in a specific order, the entities result is reordered by id and not by the specific selection
Values order
[5,2,3,1,4]
Result from transformer
[1,2,3,4,5]
To resolve this issue with beberlei/DoctrineExtensions package
Thanks