function CountableResourceTypeRepository::createResourceType

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

Overrides ResourceTypeRepository::createResourceType

File

core/modules/jsonapi/tests/modules/jsonapi_test_collection_count/src/ResourceType/CountableResourceTypeRepository.php, line 16

Class

CountableResourceTypeRepository
Provides a repository of JSON:API configurable resource types.

Namespace

Drupal\jsonapi_test_collection_count\ResourceType

Code

protected function createResourceType(EntityTypeInterface $entity_type, $bundle) {
    $raw_fields = $this->getAllFieldNames($entity_type, $bundle);
    return new CountableResourceType($entity_type->id(), $bundle, $entity_type->getClass(), $entity_type->isInternal(), static::isLocatableResourceType($entity_type, $bundle), static::isMutableResourceType($entity_type, $bundle), static::isVersionableResourceType($entity_type), static::getFields($raw_fields, $entity_type, $bundle));
}

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