Changeset 925

Show
Ignore:
Timestamp:
07/22/08 21:19:56 (3 months ago)
Author:
kaste
Message:

Added group-by clause to AR->find().

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActiveRecord.php

    r848 r925  
    10311031            return false; 
    10321032        } 
    1033         $valid_keys = array('conditions', 'include', 'joins', 'limit', 'offset', 'order', 'sort', 'bind', 'select','select_prefix', 'readonly'); 
     1033        $valid_keys = array('conditions', 'include', 'joins', 'limit', 'offset', 'group', 'order', 'sort', 'bind', 'select','select_prefix', 'readonly'); 
    10341034        foreach (array_keys($options) as $key){ 
    10351035            if (!in_array($key,$valid_keys)){ 
     
    13571357        } 
    13581358 
    1359         $sql  .= !empty($options['order']) ? ' ORDER BY  '.$options['order'] : ''; 
     1359        $sql .= !empty($options['group']) ? ' GROUP BY '.$options['group'] : '';  
     1360        $sql .= !empty($options['order']) ? ' ORDER BY '.$options['order'] : ''; 
    13601361 
    13611362        $this->_db->addLimitAndOffset($sql,$options);