You are here

public function EntityTreeBuilder::getNodeId in Entity Reference Tree Widget 8

Same name and namespace in other branches
  1. 2.x src/Tree/EntityTreeBuilder.php \Drupal\entity_reference_tree\Tree\EntityTreeBuilder::getNodeId()

Get the ID of a tree node.

Parameters

$entity: The entity for the tree node.

Return value

string|int|null The id of the tree node for the entity.

Overrides TreeBuilderInterface::getNodeId

File

src/Tree/EntityTreeBuilder.php, line 132

Class

EntityTreeBuilder
Provides a class for building a tree from general entity.

Namespace

Drupal\entity_reference_tree\Tree

Code

public function getNodeId($entity) {
  return $entity->id;
}