-
Bug
-
Resolution: Fixed
-
Minor
-
2.2.3, 2.3
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_24_STABLE
-
w28_
MDL-33568_m24_recordcounts -
The docblock above count_records_sql states that it returns an integer though this is not the case (unless the count is zero in which case an integer will be returned). Here is the current implementation:
public function count_records_sql($sql, array $params=null) {
|
if ($count = $this->get_field_sql($sql, $params)) {
|
return $count;
|
} else {
|
return 0;
|
}
|
}
|
It seems to me that this could be fixed/shorten to:
public function count_records_sql($sql, array $params=null) {
|
return (int)$this->get_field_sql($sql, $params);
|
}
|
- has been marked as being related by
-
MDL-33453 Clarify search_references[_count]() methods usage and add tests for them
-
- Closed
-