Support renamed resource types

Created on 30 January 2020, about 5 years ago
Updated 9 October 2023, over 1 year ago

The following code can retrieve the resource type name directly from the resource type object.

findDisabledMethods:

    $extract_resource_type_id = function (ResourceType $resource_type) use ($entity_type_manager) {
      $entity_type = $entity_type_manager->getDefinition($resource_type->getEntityTypeId());
      if (empty($entity_type->getKey('bundle'))) {
        return $resource_type->getEntityTypeId();
      }
      return sprintf(
        '%s%s%s',
        $resource_type->getEntityTypeId(),
        static::$DEFINITION_SEPARATOR,
        $resource_type->getBundle()
      );
    };

This is the map callback. I believe it could be reduced to the following

    return array_map(static function (ResourceType $resource_type) {
      return $resource_type->getTypeName();
    }, $disabled_resources);
πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024