在给定带ORDER和LIMIT的简单选择查询的情况下,在CakePHP中编写find()语句的正确方法是什么?

Ang*_*ine 1 php cakephp

如何使用cakephp中的find语句编写此查询

$this->Form->query("Select id from forms order by id DESC LIMIT 1")
Run Code Online (Sandbox Code Playgroud)

Pao*_*ino 5

这应该这样做:

$this->Form->find('all', array(
    'fields' => array('Form.id'),
    'order' => 'Form.id DESC',
    'limit' => 1
));
Run Code Online (Sandbox Code Playgroud)