mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-23 07:36:10 +01:00
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:
parent
a858d748ee
commit
564ca1511c
1 changed files with 11 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue