Hybrid finder results
This commit is contained in:
parent
5e19a37344
commit
76f447ba7d
5 changed files with 72 additions and 1 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace FOQ\ElasticaBundle\Transformer;
|
||||
|
||||
use FOQ\ElasticaBundle\HybridResult;
|
||||
|
||||
/**
|
||||
* Holds a collection of transformers for an index wide transformation.
|
||||
*
|
||||
|
|
@ -56,6 +58,18 @@ class ElasticaToModelTransformerCollection implements ElasticaToModelTransformer
|
|||
return $transformed;
|
||||
}
|
||||
|
||||
public function hybridTransform(array $elasticaObjects)
|
||||
{
|
||||
$objects = $this->transform($elasticaObjects);
|
||||
|
||||
$result = array();
|
||||
for ($i = 0; $i < count($elasticaObjects); $i++) {
|
||||
$result[] = new HybridResult($elasticaObjects[$i], $objects[$i]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getTypeToClassMap()
|
||||
{
|
||||
return array_map(function ($transformer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue