📜  Drupal 9 检查 UUD 是否有效 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:43.337000             🧑  作者: Mango

代码示例1
// Checks if the format of UUID is valid.
// Does not verify that the UUID matches an entity
// in the database.
use Symfony\Component\HttpKernel\Exception\HttpException;
if (empty($node_uuid) || !Uuid::isValid($node_uuid)) {
    throw new HttpException(400, 'Missing or invalid value for node uuid.');
}