function EntityTestUuidId::generateUuid
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestUuidId.php \Drupal\entity_test\Entity\EntityTestUuidId::generateUuid()
Statically generates a UUID.
Return value
string A newly generated UUID.
File
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTestUuidId.php, line 73
Class
- EntityTestUuidId
- Defines a test entity class with UUIDs as IDs.
Namespace
Drupal\entity_test\EntityCode
public static function generateUuid() : string {
$uuid = \Drupal::service('uuid');
assert($uuid instanceof UuidInterface);
return $uuid->generate();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.