feat: make odbc resultset usable with count()
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Bsr\Db;
|
namespace Bsr\Db;
|
||||||
|
|
||||||
class OdbcResultSet implements \Iterator, \ArrayAccess
|
class OdbcResultSet implements \Iterator, \ArrayAccess, \Countable
|
||||||
{
|
{
|
||||||
public $length;
|
public $length;
|
||||||
|
|
||||||
@@ -25,6 +25,10 @@ class OdbcResultSet implements \Iterator, \ArrayAccess
|
|||||||
return $this->num_rows;
|
return $this->num_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function count() {
|
||||||
|
return $this->get_num_rows();
|
||||||
|
}
|
||||||
|
|
||||||
public function is_error()
|
public function is_error()
|
||||||
{
|
{
|
||||||
return ($this->error ? true : false);
|
return ($this->error ? true : false);
|
||||||
|
|||||||
Reference in New Issue
Block a user