|
@ -81,9 +81,11 @@ class SqlCriteria |
|
|
|
|
|
|
|
|
public function count($select = 'x') |
|
|
public function count($select = 'x') |
|
|
{ |
|
|
{ |
|
|
$sql_expression_backup = $this->sql_expression; |
|
|
|
|
|
$this->select($select); |
|
|
|
|
|
$this->defineJoinExpressions(); |
|
|
$this->defineJoinExpressions(); |
|
|
|
|
|
$sql_expression_backup = $this->sql_expression; |
|
|
|
|
|
if ($select) { |
|
|
|
|
|
$this->select( $select ); |
|
|
|
|
|
} |
|
|
if (!$this->sql_expression) { |
|
|
if (!$this->sql_expression) { |
|
|
$this->sql_expression = 'SELECT COUNT(*) as count FROM :table'; |
|
|
$this->sql_expression = 'SELECT COUNT(*) as count FROM :table'; |
|
|
} |
|
|
} |
|
|