class NodeEntityHierarchyHandler in Entity Reference Hierarchy 8.2
Same name and namespace in other branches
- 3.x src/Handler/NodeEntityHierarchyHandler.php \Drupal\entity_hierarchy\Handler\NodeEntityHierarchyHandler
Defines a class for entity hierarchy implementations for node module.
Hierarchy
- class \Drupal\entity_hierarchy\Handler\NodeEntityHierarchyHandler implements EntityHierarchyHandlerInterface
Expanded class hierarchy of NodeEntityHierarchyHandler
1 file declares its use of NodeEntityHierarchyHandler
- entity_hierarchy.module in ./
entity_hierarchy.module - A module to make entities hierarchical.
File
- src/
Handler/ NodeEntityHierarchyHandler.php, line 12
Namespace
Drupal\entity_hierarchy\HandlerView source
class NodeEntityHierarchyHandler implements EntityHierarchyHandlerInterface {
/**
* {@inheritdoc}
*/
public function getAddChildUrl(EntityTypeInterface $entityType, ContentEntityInterface $parent, $bundle, $fieldName) {
return Url::fromRoute('node.add', [
'node_type' => $bundle,
], [
'query' => [
$fieldName => $parent
->id(),
],
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NodeEntityHierarchyHandler:: |
public | function |
Gets an add child URL. Overrides EntityHierarchyHandlerInterface:: |