| @@ 1361-1366 (lines=6) @@ | ||
| 1358 | */ |
|
| 1359 | public function makeGroupByWithHaving( $options ) { |
|
| 1360 | $sql = ''; |
|
| 1361 | if ( isset( $options['GROUP BY'] ) ) { |
|
| 1362 | $gb = is_array( $options['GROUP BY'] ) |
|
| 1363 | ? implode( ',', $options['GROUP BY'] ) |
|
| 1364 | : $options['GROUP BY']; |
|
| 1365 | $sql .= ' GROUP BY ' . $gb; |
|
| 1366 | } |
|
| 1367 | if ( isset( $options['HAVING'] ) ) { |
|
| 1368 | $having = is_array( $options['HAVING'] ) |
|
| 1369 | ? $this->makeList( $options['HAVING'], LIST_AND ) |
|
| @@ 1367-1372 (lines=6) @@ | ||
| 1364 | : $options['GROUP BY']; |
|
| 1365 | $sql .= ' GROUP BY ' . $gb; |
|
| 1366 | } |
|
| 1367 | if ( isset( $options['HAVING'] ) ) { |
|
| 1368 | $having = is_array( $options['HAVING'] ) |
|
| 1369 | ? $this->makeList( $options['HAVING'], LIST_AND ) |
|
| 1370 | : $options['HAVING']; |
|
| 1371 | $sql .= ' HAVING ' . $having; |
|
| 1372 | } |
|
| 1373 | ||
| 1374 | return $sql; |
|
| 1375 | } |
|
| @@ 1386-1392 (lines=7) @@ | ||
| 1383 | * @since 1.21 |
|
| 1384 | */ |
|
| 1385 | public function makeOrderBy( $options ) { |
|
| 1386 | if ( isset( $options['ORDER BY'] ) ) { |
|
| 1387 | $ob = is_array( $options['ORDER BY'] ) |
|
| 1388 | ? implode( ',', $options['ORDER BY'] ) |
|
| 1389 | : $options['ORDER BY']; |
|
| 1390 | ||
| 1391 | return ' ORDER BY ' . $ob; |
|
| 1392 | } |
|
| 1393 | ||
| 1394 | return ''; |
|
| 1395 | } |
|