Hello. I have a database field that is called "end" and contains a UNIX timestamp. However, when I try to order by that field like this:
$Project = \Common\Models\Projects::findFirst([
'conditions' => 'id=?0 AND source_id=1',
'bind' => [$projectId],
'order' => 'end DESC'
]);
Phalcon throws this exception:
Phalcon\Mvc\Model\Exception: Syntax error, unexpected token END, near to ' DESC LIMIT :APL0:', when parsing: SELECT [Common\Models\Projects].* FROM [Common\Models\Projects] WHERE id=?0 AND source_id=1 ORDER BY end DESC LIMIT :APL0: (136)
Is there a solution to this issue? In a test environment, I renamed the "end" field in the database and ran the same query, and it worked, but I would much rather keep the name of the field if possible. Please advise.