Doctrine.ORM.EntityRepository->createQueryBuilder #5007

Closed
opened 2026-01-22 14:56:25 +01:00 by admin · 2 comments
Owner

Originally created by @joshuayoung1380 on GitHub (Feb 4, 2016).

EntityRepository->createQueryBuilder does not provide to way to set the indexBy.
http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.html

EntityManager->createQueryBuilder allows the indexBy to be set via the from method
http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/query-builder.html#high-level-api-methods

EntityRepository->createQueryBuilder calls from for you, but does not all have an option for indexBy.

the EntityRepository->createQueryBuilder is used to in symfony's EntityType field for creating forms.
i was trying to index my arrayCollection by an id field for my form, just i preference that over a 0 indexed key.

http://symfony.com/doc/current/reference/forms/types/entity.html

Should EntityRepository's createQueryBuilder method allow for this?

Originally created by @joshuayoung1380 on GitHub (Feb 4, 2016). EntityRepository->createQueryBuilder does not provide to way to set the indexBy. http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.EntityRepository.html EntityManager->createQueryBuilder allows the indexBy to be set via the from method http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/query-builder.html#high-level-api-methods EntityRepository->createQueryBuilder calls from for you, but does not all have an option for indexBy. the EntityRepository->createQueryBuilder is used to in symfony's EntityType field for creating forms. i was trying to index my arrayCollection by an id field for my form, just i preference that over a 0 indexed key. http://symfony.com/doc/current/reference/forms/types/entity.html Should EntityRepository's createQueryBuilder method allow for this?
admin closed this issue 2026-01-22 14:56:26 +01:00
Author
Owner

@Ocramius commented on GitHub (Feb 4, 2016):

@joshuayoung1380 can you rephrase your question? It is really unclear:

  1. what you are trying to do
  2. what the unexpected outcome is
@Ocramius commented on GitHub (Feb 4, 2016): @joshuayoung1380 can you rephrase your question? It is really unclear: 1. what you are trying to do 2. what the unexpected outcome is
Author
Owner

@joshuayoung1380 commented on GitHub (Feb 4, 2016):

i may have been mistaking on how this was intended to work

@joshuayoung1380 commented on GitHub (Feb 4, 2016): i may have been mistaking on how this was intended to work
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5007