| @@ 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 = []; |
|
| @@ 350-360 (lines=11) @@ | ||
| 347 | return null; |
|
| 348 | } |
|
| 349 | ||
| 350 | private function hydrateEntityByResult($entity, array $searchResult) { |
|
| 351 | if (isset($searchResult['_source'])) { |
|
| 352 | $searchResult = array_merge($searchResult, $searchResult['_source']); |
|
| 353 | } |
|
| 354 | ||
| 355 | $this->hydrator->hydrate($entity, $searchResult); |
|
| 356 | $this->hydrator->hydrateByAnnotation($entity, Field::class, $searchResult); |
|
| 357 | $this->hydrator->hydrateByAnnotation($entity, MetaField::class, $searchResult); |
|
| 358 | ||
| 359 | return $entity; |
|
| 360 | } |
|
| 361 | ||
| 362 | public function update($entity) { |
|
| 363 | $type = $this->getEntityType(); |
|