* @category Horde
* @package Horde_Rdo
*/
-class Horde_Rdo_List implements Iterator
+class Horde_Rdo_List implements Iterator, Countable
{
/**
* Rdo Mapper
protected $_eof;
/**
+ * The number of objects in the list.
+ * @var integer
+ */
+ protected $_count;
+
+ /**
* Constructor.
*
* @param mixed $query The query to run when results are
// Keep a handle on the Mapper object for running the query.
$this->_mapper = $mapper;
+
+ $this->_count = $this->_mapper->count($query);
}
/**
return !$this->_eof;
}
+ public function count()
+ {
+ return $this->_count;
+ }
+
}