You are here

private function HierarchyBreadcrumbBuilder::hierarchyGetNodePrimaryAncestorNids in Entity Reference Hierarchy 8

Get the ancestor nodes for the given node.

@TODO: make this more efficient by implementing a materialized path or similar.

1 call to HierarchyBreadcrumbBuilder::hierarchyGetNodePrimaryAncestorNids()
HierarchyBreadcrumbBuilder::hierarchyGetNodePrimaryAncestorNodes in src/HierarchyBreadcrumbBuilder.php
Get the parent nodes for the given node.

File

src/HierarchyBreadcrumbBuilder.php, line 79
Contains \Drupal\entity_hierarchy\HierarchyBreadcrumbBuilder.

Class

HierarchyBreadcrumbBuilder
Provides a breadcrumb builder for nodes in a book.

Namespace

Drupal\entity_hierarchy

Code

private function hierarchyGetNodePrimaryAncestorNids($nid) {
  $out = array();
  if ($parent_nid = $this
    ->hierarchyGetNodeParentPrimaryNid($nid)) {
    $out = $this
      ->hierarchyGetNodePrimaryAncestorNids($parent_nid);
    $out[] = $parent_nid;
  }
  return $out;
}