protected static function ResourceResponseTestTrait::toResourceIdentifier in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::toResourceIdentifier()
- 9 core/modules/jsonapi/tests/src/Functional/ResourceResponseTestTrait.php \Drupal\Tests\jsonapi\Functional\ResourceResponseTestTrait::toResourceIdentifier()
Maps an entity to a resource identifier.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity to map to a resource identifier.
Return value
array A resource identifier for the given entity.
File
- core/
modules/ jsonapi/ tests/ src/ Functional/ ResourceResponseTestTrait.php, line 261
Class
- ResourceResponseTestTrait
- Utility methods for handling resource responses.
Namespace
Drupal\Tests\jsonapi\FunctionalCode
protected static function toResourceIdentifier(EntityInterface $entity) {
return [
'type' => $entity
->getEntityTypeId() . '--' . $entity
->bundle(),
'id' => $entity
->uuid(),
];
}