You are here

private function HierarchyBreadcrumbBuilder::hierarchyGetNodeParentNids in Entity Reference Hierarchy 8

Get the parent nodes for the given node.

1 call to HierarchyBreadcrumbBuilder::hierarchyGetNodeParentNids()
HierarchyBreadcrumbBuilder::hierarchyGetNodeParentPrimaryNid in src/HierarchyBreadcrumbBuilder.php
Get the primary parent nid for the given node.

File

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

Class

HierarchyBreadcrumbBuilder
Provides a breadcrumb builder for nodes in a book.

Namespace

Drupal\entity_hierarchy

Code

private function hierarchyGetNodeParentNids($node, $limit = NULL) {
  $out = array();
  foreach ($this
    ->hierarchyGetNodeParents($node, $limit) as $parent) {

    // This may be an array after a node has been submitted.
    $parent = (object) $parent;
    $out[] = $parent->pnid;
  }
  return $out;
}