Juan Jo
Juan Jo

Reputation: 892

Doctrine 1.2 how to compare dates

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

Upvotes: 7

Views: 4373

Answers (1)

Tom
Tom

Reputation: 30698

For example:

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

->where('u.created_at > ?', $one_year_ago)

Upvotes: 8

Related Questions