Fix ElasticaToModelTransformer the transform closure use Result instead of Document

This commit is contained in:
cedric lombardot 2013-08-06 20:48:38 +02:00 committed by Jeremy Mikola
parent b922315172
commit e2b6177a33

View file

@ -2,7 +2,6 @@
namespace FOS\ElasticaBundle\Propel;
use Elastica\Document;
use FOS\ElasticaBundle\HybridResult;
use FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
@ -71,9 +70,10 @@ class ElasticaToModelTransformer implements ElasticaToModelTransformerInterface
*/
public function transform(array $elasticaObjects)
{
$ids = array_map(function(Document $elasticaObject) {
return $elasticaObject->getId();
}, $elasticaObjects);
$ids = array();
foreach ($elasticaObjects as $elasticaObject) {
$ids[] = $elasticaObject->getId();
}
$objects = $this->findByIdentifiers($ids, $this->options['hydrate']);