mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
- DibiResultIterator: is countable (thanks to Roman Sklenar)
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||||
* @package dibi
|
* @package dibi
|
||||||
*/
|
*/
|
||||||
class DibiResultIterator implements Iterator
|
class DibiResultIterator implements Iterator, Countable
|
||||||
{
|
{
|
||||||
/** @var DibiResult */
|
/** @var DibiResult */
|
||||||
private $result;
|
private $result;
|
||||||
@@ -133,4 +133,14 @@ class DibiResultIterator implements Iterator
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Required by the Countable interface.
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function count()
|
||||||
|
{
|
||||||
|
return $this->result->getRowCount();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user