Skip to content

Noting API updates for the move to Entity hierarchy 5.x #139

@andybroomfield

Description

@andybroomfield

See https://www.drupal.org/project/entity_hierarchy/releases/5.x-dev

The following services/PHP APIs are removed

\Drupal\entity_hierarchy\Storage\EntityTreeNodeMapperInterface - instead use the query builder factory.
$queryBuilder = \Drupal::service('entity_hierarchy.query_builder_factory')->get($fieldName, $entity->getEntityTypeId());
$childEntities = $queryBuilder->findChildren($entity)
->filter(RecordCollectionCallable::viewLabelAccessFilter(...));
\Drupal\entity_hierarchy\Storage\NestedSetNodeKeyFactory - there is no replacement, work directly with a Drupal entity and the query factory
\Drupal\entity_hierarchy\Storage\NestedSetStorage and \Drupal\entity_hierarchy\Storage\NestedSetStorageFactory - work with the query builder factory (\Drupal\entity_hierarchy\Storage\QueryBuilderFactory instead
We no longer use the previousnext/nestedset library, so e.g. value objects like \PNX\NestedSet\Node and \PNX\NestedSet\NodeKey no longer exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions