@@ 1214-1219 (lines=6) @@ | ||
1211 | */ |
|
1212 | protected function makeGroupByWithHaving( $options ) { |
|
1213 | $sql = ''; |
|
1214 | if ( isset( $options['GROUP BY'] ) ) { |
|
1215 | $gb = is_array( $options['GROUP BY'] ) |
|
1216 | ? implode( ',', $options['GROUP BY'] ) |
|
1217 | : $options['GROUP BY']; |
|
1218 | $sql .= ' GROUP BY ' . $gb; |
|
1219 | } |
|
1220 | if ( isset( $options['HAVING'] ) ) { |
|
1221 | $having = is_array( $options['HAVING'] ) |
|
1222 | ? $this->makeList( $options['HAVING'], self::LIST_AND ) |
|
@@ 1220-1225 (lines=6) @@ | ||
1217 | : $options['GROUP BY']; |
|
1218 | $sql .= ' GROUP BY ' . $gb; |
|
1219 | } |
|
1220 | if ( isset( $options['HAVING'] ) ) { |
|
1221 | $having = is_array( $options['HAVING'] ) |
|
1222 | ? $this->makeList( $options['HAVING'], self::LIST_AND ) |
|
1223 | : $options['HAVING']; |
|
1224 | $sql .= ' HAVING ' . $having; |
|
1225 | } |
|
1226 | ||
1227 | return $sql; |
|
1228 | } |
|
@@ 1239-1245 (lines=7) @@ | ||
1236 | * @since 1.21 |
|
1237 | */ |
|
1238 | protected function makeOrderBy( $options ) { |
|
1239 | if ( isset( $options['ORDER BY'] ) ) { |
|
1240 | $ob = is_array( $options['ORDER BY'] ) |
|
1241 | ? implode( ',', $options['ORDER BY'] ) |
|
1242 | : $options['ORDER BY']; |
|
1243 | ||
1244 | return ' ORDER BY ' . $ob; |
|
1245 | } |
|
1246 | ||
1247 | return ''; |
|
1248 | } |