protected static function ResourceTypeRepository::isVersionableResourceType in JSON:API 8.2
Whether an entity type is a versionable resource type.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type to assess.
Return value
bool TRUE if the entity type is versionable, FALSE otherwise.
1 call to ResourceTypeRepository::isVersionableResourceType()
- ResourceTypeRepository::createResourceType in src/
ResourceType/ ResourceTypeRepository.php - Creates a ResourceType value object for the given entity type + bundle.
File
- src/
ResourceType/ ResourceTypeRepository.php, line 330
Class
- ResourceTypeRepository
- Provides a repository of all JSON:API resource types.
Namespace
Drupal\jsonapi\ResourceTypeCode
protected static function isVersionableResourceType(EntityTypeInterface $entity_type) {
// @todo: remove the following line and uncomment the next one when revisions have standardized access control. For now, it is unsafe to support all revisionable entity types.
return in_array($entity_type
->id(), [
'node',
'media',
]);
/* return $entity_type->isRevisionable(); */
}