* @license http://github.com/basdenooijer/solarium/raw/master/COPYING * @link http://www.solarium-project.org/ * * @package Solarium * @subpackage Result */ /** * Select component spellcheck collation result * * @package Solarium * @subpackage Result */ class Solarium_Result_Select_Spellcheck_Collation implements IteratorAggregate, Countable { /** * Query * * @var string */ protected $_query; /** * Hit count * * @var int */ protected $_hits; /** * Corrections * * @var array */ protected $_corrections; /** * Constructor * * @param string $query * @param int|null $hits * @param array $corrections */ public function __construct($query, $hits, $corrections) { $this->_query = $query; $this->_hits = $hits; $this->_corrections = $corrections; } /** * Get query string * * @return string */ public function getQuery() { return $this->_query; } /** * Get hit count * * Only available if ExtendedResults was enabled in your query * * @return int|null */ public function getHits() { return $this->_hits; } /** * Get all corrrections * * Only available if ExtendedResults was enabled in your query * * @return array */ public function getCorrections() { return $this->_corrections; } /** * IteratorAggregate implementation * * Only available if ExtendedResults was enabled in your query * * @return ArrayIterator */ public function getIterator() { return new ArrayIterator($this->_corrections); } /** * Countable implementation * * Only available if ExtendedResults was enabled in your query * * @return int */ public function count() { return count($this->_corrections); } }