Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Count method can now handle wildcards.

  • Loading branch information...
commit baee27a31fafe2d10bc273a95e9c046ab81b211a 1 parent b5bce44
Matthew A Mattson authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 classes/base/db/sql/select/builder.php
View
6 classes/base/db/sql/select/builder.php
@@ -134,9 +134,9 @@ public function column($column, $alias = NULL) {
* @return DB_SQL_Select_Builder a reference to the current instance
*/
public function count($column = '*', $alias = 'count') {
- if ($column != '*') {
- $column = $this->compiler->prepare_identifier($column);
- }
+ $column = ( ! empty($column) AND (substr_compare($column, '*', -1, 1) === 0))
+ ? $this->compiler->prepare_wildcard($column)
+ : $this->compiler->prepare_identifier($column);
return $this->column(DB_SQL::expr("COUNT({$column})"), $alias);
}
Please sign in to comment.
Something went wrong with that request. Please try again.