DDC-2322: [GH-592] Added ability to specify INDEX BY when creating a QueryBuilder from a Repository #2915

Closed
opened 2026-01-22 14:07:14 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 27, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @beberlei:

This issue is created automatically through a Github pull request on behalf of cmenning:

Url: https://github.com/doctrine/doctrine2/pull/592

Message:

This is a handy shortcut when using indexed results.

Originally created by @doctrinebot on GitHub (Feb 27, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @beberlei: This issue is created automatically through a Github pull request on behalf of cmenning: Url: https://github.com/doctrine/doctrine2/pull/592 Message: This is a handy shortcut when using indexed results.
admin added the Improvement label 2026-01-22 14:07:14 +01:00
admin closed this issue 2026-01-22 14:07:15 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2013):

Comment created by @beberlei:

A related Github Pull-Request [GH-592] was closed
https://github.com/doctrine/doctrine2/pull/592

@doctrinebot commented on GitHub (Mar 12, 2013): Comment created by @beberlei: A related Github Pull-Request [GH-592] was closed https://github.com/doctrine/doctrine2/pull/592
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Mar 12, 2013): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2013):

Comment created by cmenning:

I disagree with the reasoning behind closing this request. In DoctrineBundle, getDoctrine()->getEntityManager() has been deprecated, which leaves you to use getDoctrine()->getRepository($class)->createQueryBuilder();

Adding ->from() at that point is redundant since it's already been specified inside the createQueryBuilder() call. It seems wasteful to not allow a passthru of the $indexBy argument during the initial call when it's already supported by the from() called inside createQueryBuilder().

@doctrinebot commented on GitHub (Mar 12, 2013): Comment created by cmenning: I disagree with the reasoning behind closing this request. In DoctrineBundle, `getDoctrine()->getEntityManager()` has been deprecated, which leaves you to use `getDoctrine()->getRepository($class)->createQueryBuilder();` Adding `->from()` at that point is redundant since it's already been specified inside the createQueryBuilder() call. It seems wasteful to not allow a passthru of the $indexBy argument during the initial call when it's already supported by the from() called inside createQueryBuilder().
Author
Owner

@doctrinebot commented on GitHub (Mar 12, 2013):

Comment created by @ocramius:

The repository is already (probably) doing too much. A simpler approach with:

$qb = $em->createQueryBuilder()->select('e')->from($repo->getClassName(), 'e', 'e.stuff')

Is no big deal in my opinion.

@doctrinebot commented on GitHub (Mar 12, 2013): Comment created by @ocramius: The repository is already (probably) doing too much. A simpler approach with: ``` $qb = $em->createQueryBuilder()->select('e')->from($repo->getClassName(), 'e', 'e.stuff') ``` Is no big deal in my opinion.
Author
Owner

@doctrinebot commented on GitHub (May 1, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-592] was closed:
https://github.com/doctrine/dbal/pull/592

@doctrinebot commented on GitHub (May 1, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-592] was closed: https://github.com/doctrine/dbal/pull/592
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2915