File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -416,19 +416,23 @@ public function applyOptions(array $options)
416416 /**
417417 * Returns the total amount of results for this query
418418 *
419- * @return bool| int
419+ * @return int
420420 */
421421 public function count ()
422422 {
423423 if ($ this ->action () !== self ::ACTION_READ ) {
424- return false ;
424+ return 0 ;
425425 }
426426
427427 if (!$ this ->__resultSet ) {
428428 $ this ->_execute ();
429429 }
430430
431- return $ this ->__resultSet ->total ();
431+ if ($ this ->__resultSet ) {
432+ return $ this ->__resultSet ->total ();
433+ }
434+
435+ return 0 ;
432436 }
433437
434438 /**
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function testAliasField()
5757
5858 public function testCountNonReadAction ()
5959 {
60- $ this ->assertEquals (false , $ this ->query ->count ());
60+ $ this ->assertEquals (0 , $ this ->query ->count ());
6161 }
6262
6363 public function testCount ()
You can’t perform that action at this time.
0 commit comments