A Bono Mon Mar 26 04:59:45 -0400 2012

Subject: "group by" clause

Hi guys,

I have a difficulty using 'conditions'. I'm trying get record which have stage_id in (1,2,3,4) and group them by stage_id.
I know how to do it with SQLBuilder but would like to use finder conditions:

SQLBuilder solution: (it works)

$conn = ActiveRecord\ConnectionManager::get_connection("development");
$builder = new ActiveRecord\SQLBuilder($conn, "matches");

$builder->where("stage_id in (1,2,3,4)");

finder version: (it doesn't work)

$cond = array(
            'conditions' => array('stage_id in (?)', array(1,2,3,4), 'group', 'stage_id')
        $this->view_data['matches'] = Match::find('all', $cond);

Any ideas?