You are here

public function HierarchyManager::hierarchyGetAllowedChildTypes in Entity Reference Hierarchy 8

Get the allowed child node types for the given parent node type. This method uses configuration management to retrieve the hierarchy settings for allowed child types based on the parent node type.

Parameters

int/null $parent_type: The parent node type.

Return value

array An array of child node types allowed for a given parent node type.

Overrides HierarchyManagerInterface::hierarchyGetAllowedChildTypes

See also

hierarchyCanBeParent

NodehierarchyChildrenForm::form

1 call to HierarchyManager::hierarchyGetAllowedChildTypes()
HierarchyManager::hierarchyCanBeParent in src/HierarchyManager.php

File

src/HierarchyManager.php, line 254
Contains \Drupal\entity_hierarchy\HierarchyManager.

Class

HierarchyManager
Defines a hierarchy manager.

Namespace

Drupal\entity_hierarchy

Code

public function hierarchyGetAllowedChildTypes($parent_type) {
  $config = \Drupal::config('entity_hierarchy.settings');
  $child_types = array_filter($config
    ->get('nh_allowchild_' . $parent_type));
  return array_unique($child_types);
}