Doctrine 1.2 how to compare dates
Asked Answered
K

1

7

How can i set a condition, in a where clause of Doctrine 1.2 ORM to specify Greater than date in DQL example

Doctrine_Query::create()
    ->from('user u')
    ->where(?)
    ->execute();

Thanks

Kale answered 14/7, 2011 at 23:4 Comment(0)
M
8

For example:

$one_year_ago = date('Y-m-d H:i:s', strtotime('1 year ago'));

->where('u.created_at > ?', $one_year_ago)
Marlenemarler answered 15/7, 2011 at 9:14 Comment(1)
Thanks, thats the solution :DKale

© 2022 - 2024 — McMap. All rights reserved.