<?php
class SQLGroupByDays
{
  static public function group(CDbCriteria $dbCriteria, $timeFieldName)
  {
    $groupBy  =  "DATE(".$timeFieldName.")";

    $dbCriteria->mergeWith(array('group' => $groupBy));
    return $dbCriteria;
  }
}
