Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GuidBuilder.php

function GuidBuilder::build

Builds and returns a Guid

@psalm-pure

Parameters

CodecInterface $codec The codec to use for building this Guid instance:

string $bytes The byte string from which to construct a UUID:

Return value

Guid The GuidBuilder returns an instance of Ramsey\Uuid\Guid\Guid

Overrides UuidBuilderInterface::build

File

vendor/ramsey/uuid/src/Guid/GuidBuilder.php, line 56

Class

GuidBuilder
GuidBuilder builds instances of Guid

Namespace

Ramsey\Uuid\Guid

Code

public function build(CodecInterface $codec, string $bytes) : UuidInterface {
    try {
        return new Guid($this->buildFields($bytes), $this->numberConverter, $codec, $this->timeConverter);
    } catch (Throwable $e) {
        throw new UnableToBuildUuidException($e->getMessage(), (int) $e->getCode(), $e);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal