DDC-943: EntityRepository::findBy should support multiple values on criteria fetching #1174

Closed
opened 2026-01-22 13:04:40 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 20, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @guilhermeblanco:

Currently it is impossible to execute a multiple value findBy on EntityRepository.

So supposing we have a Foo entity, we can do this:

$foos = $em->getRepository('Foo')->findByName('value');

But it is impossible to do:

$foos = $em->getRepository('Foo')->findByName(array('value1', 'value2'));

We have most of the support done inside BasicEntityPersister, but the _getSelectConditionSQL restricts to a single value by doing:

$conditionSql .= ' = ?'; at line 1150

We can extend the support easily by detecting array value and adding an IN (...) condition on this case.

Originally created by @doctrinebot on GitHub (Dec 20, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @guilhermeblanco: Currently it is impossible to execute a multiple value findBy on EntityRepository. So supposing we have a Foo entity, we can do this: `$foos = $em->getRepository('Foo')->findByName('value');` But it is impossible to do: `$foos = $em->getRepository('Foo')->findByName(array('value1', 'value2'));` We have most of the support done inside BasicEntityPersister, but the _getSelectConditionSQL restricts to a single value by doing: `$conditionSql .= ' = ?';` at line 1150 We can extend the support easily by detecting array value and adding an IN (...) condition on this case.
admin added the Improvement label 2026-01-22 13:04:40 +01:00
admin closed this issue 2026-01-22 13:04:41 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 20, 2010):

Comment created by @beberlei:

This is not going into 2.0 anymore

@doctrinebot commented on GitHub (Dec 20, 2010): Comment created by @beberlei: This is not going into 2.0 anymore
Author
Owner

@doctrinebot commented on GitHub (Dec 24, 2010):

Comment created by @beberlei:

Schedule for 2.1, there are some gotachs here though.

@doctrinebot commented on GitHub (Dec 24, 2010): Comment created by @beberlei: Schedule for 2.1, there are some gotachs here though.
Author
Owner

@doctrinebot commented on GitHub (Mar 16, 2011):

Comment created by @beberlei:

Implemented as part of DDC-952

@doctrinebot commented on GitHub (Mar 16, 2011): Comment created by @beberlei: Implemented as part of [DDC-952](http://www.doctrine-project.org/jira/browse/DDC-952)
Author
Owner

@doctrinebot commented on GitHub (Mar 16, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Mar 16, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1174