* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component highlighting result item * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_Highlighting_Result implements IteratorAggregate, Countable { /** * Fields array * * @var array */ protected $_fields; /** * Constructor * * @param array $fields * @return void */ public function __construct($fields) { $this->_fields = $fields; } /** * Get highlights for all fields * * @return array */ public function getFields() { return $this->_fields; } /** * Get highlights for a single field * * @param string $key * @return array */ public function getField($key) { if (isset($this->_fields[$key])) { return $this->_fields[$key]; } else { return array(); } } /** * IteratorAggregate implementation * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_fields); } /** * Countable implementation * * @return int */ public function count() { return count($this->_fields); } }