DDC-2190: findBy() support finding by a single DateTime but not by multiple DateTime #2756

Open
opened 2026-01-22 14:02:34 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 6, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user stof:

The following code works:

$repository->findBy(array('date' => new \DateTime()))

but the following code fails as it does not apply the conversion of the date type for each element:

$repository->findBy(array('date' => array(new \DateTime(), new \DateTime('tomorrow')))

Originally created by @doctrinebot on GitHub (Dec 6, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user stof: The following code works: `$repository->findBy(array('date' => new \DateTime()))` but the following code fails as it does not apply the conversion of the `date` type for each element: `$repository->findBy(array('date' => array(new \DateTime(), new \DateTime('tomorrow')))`
admin added the Bug label 2026-01-22 14:02:34 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 6, 2013):

Comment created by @beberlei:

This is actually very hard to implement, the problem is that we only have ARRAY constants for PDO::PARAM_INT and PDO::PARAM_STR - all the other types would require special handling.

@doctrinebot commented on GitHub (Jan 6, 2013): Comment created by @beberlei: This is actually very hard to implement, the problem is that we only have ARRAY constants for PDO::PARAM_INT and PDO::PARAM_STR - all the other types would require special handling.
Author
Owner

@doctrinebot commented on GitHub (May 9, 2013):

Comment created by @beberlei:

Attaching failing testcase.

The idea is to have something like "datetime[]" as type and detect this in the SQLParserUtils of DBAL.

Another approach would be to convert the values in the ORM already, before passing to the DBAL.

@doctrinebot commented on GitHub (May 9, 2013): Comment created by @beberlei: Attaching failing testcase. The idea is to have something like "datetime[]" as type and detect this in the SQLParserUtils of DBAL. Another approach would be to convert the values in the ORM already, before passing to the DBAL.
Author
Owner

@kalifg commented on GitHub (May 17, 2018):

We are running into this a lot now that we are starting to use the ramsey uuid_binary_ordered_time type for our PK.

@kalifg commented on GitHub (May 17, 2018): We are running into this a lot now that we are starting to use the `ramsey` `uuid_binary_ordered_time` type for our PK.
Author
Owner

@Ocramius commented on GitHub (May 17, 2018):

This cannot work due to lack of expressiveness in the DBAL type system, which is not capable of representing nested custom types

@Ocramius commented on GitHub (May 17, 2018): This cannot work due to lack of expressiveness in the DBAL type system, which is not capable of representing nested custom types
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2756