Merge pull request #98 from nurikabe/patch-1

Throw RuntimeException when all Elastica objects cannot be found via Doctrine
This commit is contained in:
Richard Miller 2012-05-05 08:56:04 -07:00
commit bb57c84aff

View file

@ -72,6 +72,9 @@ abstract class AbstractElasticaToModelTransformer implements ElasticaToModelTran
return $elasticaObject->getId();
}, $elasticaObjects);
$objects = $this->findByIdentifiers($this->objectClass, $this->options['identifier'], $ids, $this->options['hydrate']);
if (count($objects) < count($elasticaObjects)) {
throw new \RuntimeException('Cannot find corresponding Doctrine objects for all Elastica results.');
};
$identifierGetter = 'get'.ucfirst($this->options['identifier']);