You are here

protected function ArrayWidget::buildChildren in Facets 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 ArrayWidget::buildChildren()
ArrayWidget::buildListItems in src/Plugin/facets/widget/ArrayWidget.php
Builds a renderable array of result items.

File

src/Plugin/facets/widget/ArrayWidget.php, line 98

Class

ArrayWidget
A simple widget class that returns a simple array of the facet results.

Namespace

Drupal\facets\Plugin\facets\widget

Code

protected function buildChildren(ResultInterface $child) {
  $values = $this
    ->generateValues($child);
  if (!is_null($child
    ->getUrl())) {
    $facet_values['url'] = $child
      ->getUrl()
      ->setAbsolute()
      ->toString();
    $facet_values['values'] = $values;
  }
  else {
    $facet_values = $values;
  }
  return $facet_values;
}