You are here

public function Result::hasActiveChildren in Facets 8

Returns true if the value has active children(selected).

Return value

bool A boolean indicating the active state of children.

Overrides ResultInterface::hasActiveChildren

File

src/Result/Result.php, line 164

Class

Result
The default implementation of the result interfaces.

Namespace

Drupal\facets\Result

Code

public function hasActiveChildren() {
  foreach ($this
    ->getChildren() as $child) {
    if ($child
      ->isActive() || $child
      ->hasActiveChildren()) {
      return TRUE;
    }
  }
  return FALSE;
}