for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ONGR\ElasticsearchBundle\Result;
use ONGR\ElasticsearchBundle\Result\Aggregation\AggregationValue;
use ONGR\ElasticsearchBundle\Service\Manager;
/**
* Class DocumentIterator.
class ArrayIterator extends AbstractResultsIterator implements \ArrayAccess
{
* {@inheritdoc}
public function offsetExists($offset)
return $this->documentExists($offset);
}
public function offsetGet($offset)
return $this->getDocument($offset);
public function offsetSet($offset, $value)
$this->documents[$offset] = $value;
public function offsetUnset($offset)
unset($this->documents[$offset]);
protected function convertDocument(array $document)
if (array_key_exists('_source', $document)) {
return $document['_source'];
} elseif (array_key_exists('fields', $document)) {
return array_map('reset', $document['fields']);
return $document;