* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component grouping field value group result * * @since 2.1.0 * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_Grouping_ValueGroup implements IteratorAggregate, Countable { /** * Field value * * @var string */ protected $_value; /** * NumFound * * @var int */ protected $_numFound; /** * Start position * * @var int */ protected $_start; /** * Documents in this group * * @var array */ protected $_documents; /** * Constructor * * @param string $value * @param int $numFound * @param int $start * @param array $documents * @return void */ public function __construct($value, $numFound, $start, $documents) { $this->_value = $value; $this->_numFound = $numFound; $this->_start = $start; $this->_documents = $documents; } /** * Get value * * @return string */ public function getValue() { return $this->_value; } /** * Get numFound * * @return int */ public function getNumFound() { return $this->_numFound; } /** * Get start * * @return int */ public function getStart() { return $this->_start; } /** * Get all documents * * @return array */ public function getDocuments() { return $this->_documents; } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_documents); } /** * Countable implementation * * @return int */ public function count() { return count($this->_documents); } }