function ResourceTypeRepository::getByTypeName

Same name in other branches
  1. 9 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getByTypeName()
  2. 10 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getByTypeName()
  3. 11.x core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::getByTypeName()

Overrides ResourceTypeRepositoryInterface::getByTypeName

1 call to ResourceTypeRepository::getByTypeName()
ResourceTypeRepository::get in core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php
Gets a specific JSON:API resource type based on entity type ID and bundle.

File

core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php, line 188

Class

ResourceTypeRepository
Provides a repository of all JSON:API resource types.

Namespace

Drupal\jsonapi\ResourceType

Code

public function getByTypeName($type_name) {
    $resource_types = $this->all();
    return isset($resource_types[$type_name]) ? $resource_types[$type_name] : NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.