+ // count with multiple joins and no conditions can be quite slow - so if there are no conditions - just remove the joins from the count.
+ $xx = clone($x);
+ $old_where = $x->whereAdd();
+ if (empty($old_where )) {
+ $xx->_join = '';
+ } else {
+ $x->whereAdd($old_where);
+ $xx=clone($x);
+
+ }
+ $total = false;
+ if (!isset($_REQUEST['_no_count'])) {
+ $total = $xx->count($this->countWhat);
+ }
+ if (isset($xx->_real_total)) { // this is used when we subquery the search.
+ $total = $xx->_real_total;
+ }