Create a new grouping for the WHERE or HAVING clause.
$type: Either 'AND' or 'OR'. All items within this group will be added to the WHERE clause with this logical operator.
$group: An ID to use for this group. If unspecified, an ID will be generated.
$where: 'where' or 'having'.
$group The group ID generated.
public function setWhereGroup($type = 'AND', $group = NULL, $where = 'where') {
// Set an alias.
$groups =& $this->{$where};
if (!isset($group)) {
$group = empty($groups) ? 1 : max(array_keys($groups)) + 1;
}
// Create an empty group
if (empty($groups[$group])) {
$groups[$group] = array(
'conditions' => array(),
'args' => array(),
);
}
$groups[$group]['type'] = strtoupper($type);
return $group;
}