Merge pull request #98 from nurikabe/patch-1
Throw RuntimeException when all Elastica objects cannot be found via Doctrine
This commit is contained in:
commit
bb57c84aff
|
@ -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']);
|
||||
|
||||
|
|
Loading…
Reference in a new issue