* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component grouping field group result * * @since 2.1.0 * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_Grouping_FieldGroup implements IteratorAggregate, Countable { /** * Match count * * @var int */ protected $_matches; /** * Number of groups * * @var int */ protected $_numberOfGroups; /** * Value groups * * @var array */ protected $_valueGroups; /** * Constructor * * @param int $matches * @param int $numberOfGroups * @param array $groups * @return void */ public function __construct($matches, $numberOfGroups, $groups) { $this->_matches = $matches; $this->_numberOfGroups = $numberOfGroups; $this->_valueGroups = $groups; } /** * Get matches value * * @return int */ public function getMatches() { return $this->_matches; } /** * Get numberOfGroups value * * Only available if the numberofgroups option in the query was 'true' * * @return int */ public function getNumberOfGroups() { return $this->_numberOfGroups; } /** * Get all value groups * * @return array */ public function getValueGroups() { return $this->_valueGroups; } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_valueGroups); } /** * Countable implementation * * @return int */ public function count() { return count($this->_valueGroups); } }