protected function buildOrderBy()
{
$sql =& $this->_sql;
if (count($this->orderBy) == 0) {
return;
}
$sql[] = "ORDER BY";
$orderByData = array();
foreach ($this->orderBy as $key => $value) {
if (is_int($key)) {
$orderByData[] = "{$value}";
} else {
$orderByData[] = "{$key} {$value}";
}
}
$sql[] = implode(', ', $orderByData);
}