Answers for "Drupal 9 check if UUD is valid"

PHP
0

Drupal 9 check if UUD is valid

// Checks if the format of UUID is valid.
// Does not verify that the UUID matches an entity
// in the database.
use SymfonyComponentHttpKernelExceptionHttpException;
if (empty($node_uuid) || !Uuid::isValid($node_uuid)) {
    throw new HttpException(400, 'Missing or invalid value for node uuid.');
}
Posted by: Guest on January-04-2022

Browse Popular Code Answers by Language