* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Analysis document query result * * @package Solarium * @subpackage Result */ class Solarium_Result_Analysis_Document extends Solarium_Result_QueryType implements IteratorAggregate, Countable { /** * Document instances array * * @var array */ protected $_items; /** * Status code returned by Solr * * @var int */ protected $_status; /** * Solr index queryTime * * This doesn't include things like the HTTP responsetime. Purely the Solr * query execution time. * * @var int */ protected $_queryTime; /** * Get Solr status code * * This is not the HTTP status code! The normal value for success is 0. * * @return int */ public function getStatus() { $this->_parseResponse(); return $this->_status; } /** * Get Solr query time * * This doesn't include things like the HTTP responsetime. Purely the Solr * query execution time. * * @return int */ public function getQueryTime() { $this->_parseResponse(); return $this->_queryTime; } /** * Get all documents * * @return array */ public function getDocuments() { $this->_parseResponse(); return $this->_items; } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { $this->_parseResponse(); return new ArrayIterator($this->_items); } /** * Countable implementation * * @return int */ public function count() { $this->_parseResponse(); return count($this->_items); } /** * Get a document by uniquekey value * * @param string $key * @return Solarium_Result_Analysis_List|null */ public function getDocument($key) { $this->_parseResponse(); if (isset($this->_items[$key])) { return $this->_items[$key]; } else { return null; } } }