You are here

class NodeEntityHierarchyHandler in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x src/Handler/NodeEntityHierarchyHandler.php \Drupal\entity_hierarchy\Handler\NodeEntityHierarchyHandler

Defines a class for entity hierarchy implementations for node module.

Hierarchy

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\Handler
View 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