public function HierarchyOutlineStorage::loadHierarchies in Entity Reference Hierarchy 8
Overrides HierarchyOutlineStorageInterface::loadHierarchies
File
- src/
HierarchyOutlineStorage.php, line 219 - Definition of Drupal\entity_hierarchy\HierarchyOutlineStorage.
Class
- HierarchyOutlineStorage
- Defines a storage class for hierarchies outline.
Namespace
Drupal\entity_hierarchyCode
public function loadHierarchies($nids) {
$results = db_select('entity_hierarchy', 'h')
->fields('h', array(
'pnid',
))
->condition('h.cnid', $nids, 'IN')
->execute()
->fetchAllAssoc('pnid', \PDO::FETCH_ASSOC);
$pnids = array();
foreach ($results as $result) {
$pnids[] = $result['pnid'];
}
return $pnids;
}