/** * Implementation of count() for Countable * * @return integer Number of elements in the list */ public function count() { if (is_null($this->_count)) { $this->_count = $this->_mapper->count($this->_query); } return $this->_count; }