class CountableResourceTypeRepository in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/tests/modules/jsonapi_test_collection_count/src/ResourceType/CountableResourceTypeRepository.php \Drupal\jsonapi_test_collection_count\ResourceType\CountableResourceTypeRepository
Provides a repository of JSON:API configurable resource types.
Hierarchy
- class \Drupal\jsonapi\ResourceType\ResourceTypeRepository implements ResourceTypeRepositoryInterface
- class \Drupal\jsonapi_test_collection_count\ResourceType\CountableResourceTypeRepository
Expanded class hierarchy of CountableResourceTypeRepository
1 string reference to 'CountableResourceTypeRepository'
- jsonapi_test_collection_count.services.yml in core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_collection_count/ jsonapi_test_collection_count.services.yml - core/modules/jsonapi/tests/modules/jsonapi_test_collection_count/jsonapi_test_collection_count.services.yml
1 service uses CountableResourceTypeRepository
- count.jsonapi.resource_type.repository in core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_collection_count/ jsonapi_test_collection_count.services.yml - Drupal\jsonapi_test_collection_count\ResourceType\CountableResourceTypeRepository
File
- core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_collection_count/ src/ ResourceType/ CountableResourceTypeRepository.php, line 11
Namespace
Drupal\jsonapi_test_collection_count\ResourceTypeView source
class CountableResourceTypeRepository extends ResourceTypeRepository {
/**
* {@inheritdoc}
*/
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));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CountableResourceTypeRepository:: |
protected | function |
Creates a ResourceType value object for the given entity type + bundle. Overrides ResourceTypeRepository:: |
|
ResourceTypeRepository:: |
protected | property | The cache backend. | |
ResourceTypeRepository:: |
protected | property | Cache tags used for caching the repository. | |
ResourceTypeRepository:: |
protected | property | The entity field manager. | |
ResourceTypeRepository:: |
protected | property | The bundle manager. | |
ResourceTypeRepository:: |
protected | property | The entity type manager. | |
ResourceTypeRepository:: |
protected | property | The event dispatcher. | |
ResourceTypeRepository:: |
public | function |
Gets all JSON:API resource types. Overrides ResourceTypeRepositoryInterface:: |
|
ResourceTypeRepository:: |
protected | function | Calculates relatable JSON:API resource types for a given resource type. | |
ResourceTypeRepository:: |
public | function |
Gets a specific JSON:API resource type based on entity type ID and bundle. Overrides ResourceTypeRepositoryInterface:: |
|
ResourceTypeRepository:: |
protected | function | Gets all bundle IDs for a given entity type. | |
ResourceTypeRepository:: |
protected | function | Gets all field names for a given entity type and bundle. | |
ResourceTypeRepository:: |
public | function |
Gets a specific JSON:API resource type based on a supplied typename. Overrides ResourceTypeRepositoryInterface:: |
|
ResourceTypeRepository:: |
protected | function | Gets the field mapping for the given field names and entity type + bundle. | |
ResourceTypeRepository:: |
protected | function | Gets the field mapping for the given field names and entity type + bundle. | 1 |
ResourceTypeRepository:: |
protected | function | Get relatable resource types from a field definition. | |
ResourceTypeRepository:: |
protected static | function | Whether an entity type + bundle maps to a locatable resource type. | |
ResourceTypeRepository:: |
protected static | function | Whether an entity type + bundle maps to a mutable resource type. | |
ResourceTypeRepository:: |
protected | function | Determines if a given field definition is a reference field. | |
ResourceTypeRepository:: |
protected static | function | Whether an entity type is a versionable resource type. | |
ResourceTypeRepository:: |
public | function | Instantiates a ResourceTypeRepository object. |