| @@ 286-296 (lines=11) @@ | ||
| 283 | } |
|
| 284 | } |
|
| 285 | ||
| 286 | private function hydrateEntityByResult($entity, array $searchResult) { |
|
| 287 | if (isset($searchResult['_source'])) { |
|
| 288 | $searchResult = array_merge($searchResult, $searchResult['_source']); |
|
| 289 | } |
|
| 290 | ||
| 291 | $this->hydrator->hydrate($entity, $searchResult); |
|
| 292 | $this->hydrator->hydrateByAnnotation($entity, Field::class, $searchResult); |
|
| 293 | $this->hydrator->hydrateByAnnotation($entity, MetaField::class, $searchResult); |
|
| 294 | ||
| 295 | return $entity; |
|
| 296 | } |
|
| 297 | ||
| 298 | public function update($entity) { |
|
| 299 | $type = $this->getEntityType(); |
|
| @@ 61-71 (lines=11) @@ | ||
| 58 | return $results; |
|
| 59 | } |
|
| 60 | ||
| 61 | private function hydrateEntityWith($entity, array $rawData) { |
|
| 62 | $this->_hydrator->hydrate($entity, $rawData); |
|
| 63 | $this->_hydrator->hydrateByAnnotation($entity, Field::class, $rawData); |
|
| 64 | $this->_hydrator->hydrateByAnnotation($entity, MetaField::class, $rawData); |
|
| 65 | ||
| 66 | if (isset($rawData['_source'])) { |
|
| 67 | $this->hydrateEntityWith($entity, $rawData['_source']); |
|
| 68 | } |
|
| 69 | ||
| 70 | return $entity; |
|
| 71 | } |
|
| 72 | ||
| 73 | private function fetchElasticResult(SearchParams $searchParams) { |
|
| 74 | $results = []; |
|