| @@ 1366-1371 (lines=6) @@ | ||
| 1363 | */ |
|
| 1364 | public function makeGroupByWithHaving( $options ) { |
|
| 1365 | $sql = ''; |
|
| 1366 | if ( isset( $options['GROUP BY'] ) ) { |
|
| 1367 | $gb = is_array( $options['GROUP BY'] ) |
|
| 1368 | ? implode( ',', $options['GROUP BY'] ) |
|
| 1369 | : $options['GROUP BY']; |
|
| 1370 | $sql .= ' GROUP BY ' . $gb; |
|
| 1371 | } |
|
| 1372 | if ( isset( $options['HAVING'] ) ) { |
|
| 1373 | $having = is_array( $options['HAVING'] ) |
|
| 1374 | ? $this->makeList( $options['HAVING'], LIST_AND ) |
|
| @@ 1372-1377 (lines=6) @@ | ||
| 1369 | : $options['GROUP BY']; |
|
| 1370 | $sql .= ' GROUP BY ' . $gb; |
|
| 1371 | } |
|
| 1372 | if ( isset( $options['HAVING'] ) ) { |
|
| 1373 | $having = is_array( $options['HAVING'] ) |
|
| 1374 | ? $this->makeList( $options['HAVING'], LIST_AND ) |
|
| 1375 | : $options['HAVING']; |
|
| 1376 | $sql .= ' HAVING ' . $having; |
|
| 1377 | } |
|
| 1378 | ||
| 1379 | return $sql; |
|
| 1380 | } |
|
| @@ 1391-1397 (lines=7) @@ | ||
| 1388 | * @since 1.21 |
|
| 1389 | */ |
|
| 1390 | public function makeOrderBy( $options ) { |
|
| 1391 | if ( isset( $options['ORDER BY'] ) ) { |
|
| 1392 | $ob = is_array( $options['ORDER BY'] ) |
|
| 1393 | ? implode( ',', $options['ORDER BY'] ) |
|
| 1394 | : $options['ORDER BY']; |
|
| 1395 | ||
| 1396 | return ' ORDER BY ' . $ob; |
|
| 1397 | } |
|
| 1398 | ||
| 1399 | return ''; |
|
| 1400 | } |
|