Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

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

Url: #592

Message:

This is a handy shortcut when using indexed results.

@doctrinebot

Comment created by @beberlei:

A related Github Pull-Request [GH-592] was closed
#592

@doctrinebot

Issue was closed with resolution "Invalid"

@doctrinebot

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

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

Comment created by @doctrinebot:

A related Github Pull-Request [GH-592] was closed:
doctrine/dbal#592

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.