Details
Description
Supports native DateTime in query parameters. (for more universal using)
Column definition
/** * @var DateTime * * @Column(type="datetime") */ private $published;
Query
$qb = $em->getRepository('Entities\Foo')->createQueryBuilder('f');
$qb->where("f.published <= ?1");
$qb->setParameter(1, new \DateTime('2012-12-21 23:59:59'));
Now display "Object of class DateTime could not be converted to string" error
This is another case for possible optimizations in my opinion, is it possible to access the parameter needles from the ResultSetMapping? If so then we should add a convertToParam method to each Doctrine\DBAL\Types\Type and allow conversions to take place or just do nothing. This woulld help with this issue, aswell as with other more complex types to be bound.