How write this phalcon query ?

How write this Phalcon\Model query?

SELECT * FROM reset WHERE createdon < UNIX_TIMESTAMP(NOW() - INTERVAL 1 DAY )

Thanks.

This syntax is not supported because it's a MySQL extension that cannot be translated by PHQL when using PostgreSQL/SQlite/Oracle. You can use a raw sql query in this case: http://docs.phalconphp.com/en/latest/reference/phql.html#using-raw-sql

Another way is to using the MysqlExtended Dialect class: https://github.com/phalcon/incubator/tree/master/Library/Phalcon/Db/Dialect

edited Nov '16

it works : )

$day = time()-86400;

$rs = Reset::find("createdon < $day");

It is bab practice to inject criteria params into PHQL. You have to use bind in order to allow PHQL engine use query cache:

$rs = Reset::find([
    'createdon > :day:',
    'bind' => [
        'day' => time() - 86400
    ]
]);

For more information see: https://docs.phalconphp.com/en/latest/reference/models.html#binding-parameters