Open doctrinebot opened 10 years ago
Any plan to add expression to compare date? Or a loose equal == instead of ===
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.
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 insteadCriteria::create()->where(Criteria::expr()->in('day', array($day)))