* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component debug documentset result * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_Debug_DocumentSet implements IteratorAggregate, Countable { /** * Docs array * * @var array */ protected $_docs; /** * Constructor * * @param array $docs * @return void */ public function __construct($docs) { $this->_docs = $docs; } /** * Get a document by key * * @param mixed $key * @return Solarium_Result_Select_Debug_Document|null */ public function getDocument($key) { if (isset($this->_docs[$key])) { return $this->_docs[$key]; } else { return null; } } /** * Get all docs * * @return array */ public function getDocuments() { return $this->_docs; } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_docs); } /** * Countable implementation * * @return int */ public function count() { return count($this->_docs); } }