You are here

protected function EntityNormalizerTrait::getResourceConfig in JSON:API Extras 8

Same name and namespace in other branches
  1. 8.2 src/Normalizer/EntityNormalizerTrait.php \Drupal\jsonapi_extras\Normalizer\EntityNormalizerTrait::getResourceConfig()

Get the configuration entity based on the entity type and bundle.

Parameters

string $entity_type_id: The entity type ID.

string $bundle_id: The bundle ID.

Return value

\Drupal\Core\Entity\EntityInterface|null The resource config entity or NULL.

1 call to EntityNormalizerTrait::getResourceConfig()
EntityNormalizerTrait::normalize in src/Normalizer/EntityNormalizerTrait.php

File

src/Normalizer/EntityNormalizerTrait.php, line 92

Class

EntityNormalizerTrait
Common code for entity normalizers.

Namespace

Drupal\jsonapi_extras\Normalizer

Code

protected function getResourceConfig($entity_type_id, $bundle_id) {
  $id = sprintf('%s--%s', $entity_type_id, $bundle_id);

  // TODO: Inject this service.
  $resource_config = \Drupal::entityTypeManager()
    ->getStorage('jsonapi_resource_config')
    ->load($id);
  return $resource_config;
}