protected function JsonApiResponseWidget::buildChildren in JSON:API Search API 8
Builds an array for children results.
Parameters
\Drupal\facets\Result\ResultInterface $child: A result item.
Return value
array An array with the results.
1 call to JsonApiResponseWidget::buildChildren()
- JsonApiResponseWidget::buildListItems in modules/
jsonapi_search_api_facets/ src/ Plugin/ facets/ widget/ JsonApiResponseWidget.php - Builds a renderable array of result items.
File
- modules/
jsonapi_search_api_facets/ src/ Plugin/ facets/ widget/ JsonApiResponseWidget.php, line 101
Class
- JsonApiResponseWidget
- A simple widget class that returns for inclusion in JSON:API Search API.
Namespace
Drupal\jsonapi_search_api_facets\Plugin\facets\widgetCode
protected function buildChildren(ResultInterface $child) {
$values = $this
->generateValues($child);
$url = $child
->getUrl();
if ($url !== NULL) {
$facet_values['url'] = $url
->setAbsolute(TRUE)
->toString(TRUE)
->getGeneratedUrl();
$facet_values['values'] = $values;
}
else {
$facet_values = $values;
}
return $facet_values;
}