Skip to content

Commit 62ad414

Browse files
committed
Make count protected. handle empty result
1 parent ef82577 commit 62ad414

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dbObject.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,11 @@ private function join ($objectName, $key = null, $joinType = 'LEFT') {
409409
*
410410
* @return int
411411
*/
412-
private function count () {
412+
protected function count () {
413413
$res = $this->db->ArrayBuilder()->getValue ($this->dbTable, "count(*)");
414-
return $res['cnt'];
414+
if (!$res)
415+
return 0;
416+
return $res;
415417
}
416418

417419
/**

0 commit comments

Comments
 (0)