CakePHP: MySQL “BETWEEN” with find parameters

I use the BETWEEN in SQL queries quite often so when I couldn’t work out how to use it in CakePHP’s $model->find() method, I was more than a little frustrated. The normal Google search didn’t help, but I’ve managed to work it out with a quick look at the core CakePHP code.

It’s a simple as:

$fp = array( 'conditions' => array( 'id BETWEEN ? AND ?' => array( 286, 291 ) ) );
$this->Goal->find('all', $fp);