You are here

protected function EntityReferenceHierarchy::getTreeStorage in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/EntityReferenceHierarchy.php \Drupal\entity_hierarchy\Plugin\Field\FieldType\EntityReferenceHierarchy::getTreeStorage()

Returns the tree storage.

Return value

\Drupal\entity_hierarchy\Storage\NestedSetStorage Tree storage.

1 call to EntityReferenceHierarchy::getTreeStorage()
EntityReferenceHierarchy::postSave in src/Plugin/Field/FieldType/EntityReferenceHierarchy.php
Defines custom post-save behavior for field values.

File

src/Plugin/Field/FieldType/EntityReferenceHierarchy.php, line 199

Class

EntityReferenceHierarchy
Plugin implementation of the 'entity_reference_hierarchy' field type.

Namespace

Drupal\entity_hierarchy\Plugin\Field\FieldType

Code

protected function getTreeStorage() {
  $fieldDefinition = $this
    ->getFieldDefinition();
  return \Drupal::service('entity_hierarchy.nested_set_storage_factory')
    ->get($fieldDefinition
    ->getName(), $fieldDefinition
    ->getTargetEntityTypeId());
}