mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-3291: Cannot use eq expression for comparison of DateTime #4072
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Sep 1, 2014).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user sparrowek:
When I use return ArrayCollection::matching() with criteria defined with eq expression like that:
Criteria::create()->where(Criteria::expr()->eq('day', $day))I get no results since equality operator uses === comparison which will almost always return false for objects. The only way I found to get around this is to use in operator instead
Criteria::create()->where(Criteria::expr()->in('day', array($day)))@jamesmoey commented on GitHub (Sep 16, 2017):
Any plan to add expression to compare date? Or a loose equal == instead of ===
@Ocramius commented on GitHub (Sep 16, 2017):
No plans for that, and we won't add exceptions for custom scalar types, such as
DateTime, so for now you will need to stick to DQL functions.