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