localgovdrupal / localgov_subsites

Replaces LocalGov Campaigns with a new name and extended functionality to support subsites within LocalGov Drupal installations.
GNU General Public License v2.0
4 stars 2 forks source link

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

Open andybroomfield opened 7 months ago

andybroomfield commented 7 months ago

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