Commit 62ad414d authored by Alexander Butenko's avatar Alexander Butenko

Make count protected. handle empty result

parent ef825779
...@@ -409,9 +409,11 @@ class dbObject { ...@@ -409,9 +409,11 @@ class dbObject {
* *
* @return int * @return int
*/ */
private function count () { protected function count () {
$res = $this->db->ArrayBuilder()->getValue ($this->dbTable, "count(*)"); $res = $this->db->ArrayBuilder()->getValue ($this->dbTable, "count(*)");
return $res['cnt']; if (!$res)
return 0;
return $res;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment