Skip to content


DDC-425: E_NOTICE in Doctrine/ORM/UnitOfWork.php when using DateTime w/ DQL #4924

doctrinebot opened this Issue · 3 comments

1 participant


Jira issue originally created by user jakajancar:

I'm trying to do the following:

$this->em->createQuery('DELETE Foo f WHERE f.someTimedateField > ?1')->execute(array(1=>new \DateTime()));

Which results in
E_NOTICE (8): Undefined index: 0000000051c01e2c00000000e1c5cc8d
in Doctrine/ORM/UnitOfWork.php:1916


Comment created by romanb:

Reproduced successfully and scheduled for BETA1.


Comment created by romanb:

You can now use explicit binding types to work around this issue:

use DateTime, Doctrine\DBAL\Types\Type;
$query->setParameter(1, new DateTime(), Type::DATETIME);

The DQL parser can not yet automatically infer the type of the bound parameter from the field (e.someDatetimeField) during parsing because this is non-trivial. Maybe this will change in the future.


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone
@doctrinebot doctrinebot closed this
@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.