function ResourceTypeRepository::isMutableResourceType
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::isMutableResourceType()
- 10 core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::isMutableResourceType()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php \Drupal\jsonapi\ResourceType\ResourceTypeRepository::isMutableResourceType()
Whether an entity type + bundle maps to a mutable resource type.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to assess.
string $bundle: The bundle to assess.
Return value
bool TRUE if the entity type is mutable, FALSE otherwise.
2 calls to ResourceTypeRepository::isMutableResourceType()
- CountableResourceTypeRepository::createResourceType in core/
modules/ jsonapi/ tests/ modules/ jsonapi_test_collection_count/ src/ ResourceType/ CountableResourceTypeRepository.php - Creates a ResourceType value object for the given entity type + bundle.
- ResourceTypeRepository::createResourceType in core/
modules/ jsonapi/ src/ ResourceType/ ResourceTypeRepository.php - Creates a ResourceType value object for the given entity type + bundle.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceTypeRepository.php, line 375
Class
- ResourceTypeRepository
- Provides a repository of all JSON:API resource types.
Namespace
Drupal\jsonapi\ResourceTypeCode
protected static function isMutableResourceType(EntityTypeInterface $entity_type, $bundle) {
assert(is_string($bundle) && !empty($bundle), 'A bundle ID is required. Bundleless entity types should pass the entity type ID again.');
return !$entity_type instanceof ConfigEntityTypeInterface;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.