Skip to content

Loading…

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

Open
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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')))

@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

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.

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added the Bug label
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.