TASK: Refactor code into common flow

As we have the same flow in some more places, we refactor this part to
follow this conventions.
This commit is contained in:
Daniel Siepmann 2018-12-29 18:07:25 +01:00
parent a858d748ee
commit 564ca1511c
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -121,7 +121,11 @@ class SearchResult implements SearchResultInterface
}
$this->facets = [];
if ($this->result->hasAggregations()) {
if ($this->result->hasAggregations() === false) {
return;
}
foreach ($this->result->getAggregations() as $aggregationName => $aggregation) {
$this->facets[$aggregationName] = $this->objectManager->get(
Facet::class,
@ -130,7 +134,6 @@ class SearchResult implements SearchResultInterface
);
}
}
}
/**
* Countable - Interface