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

Breadcrumb

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

function SymfonyCaster::castUlid

File

vendor/symfony/var-dumper/Caster/SymfonyCaster.php, line 109

Class

SymfonyCaster
@final

Namespace

Symfony\Component\VarDumper\Caster

Code

public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested) : array {
    $a[Caster::PREFIX_VIRTUAL . 'toBase58'] = $ulid->toBase58();
    $a[Caster::PREFIX_VIRTUAL . 'toRfc4122'] = $ulid->toRfc4122();
    // symfony/uid >= 5.3
    if (method_exists($ulid, 'getDateTime')) {
        $a[Caster::PREFIX_VIRTUAL . 'time'] = $ulid->getDateTime()
            ->format('Y-m-d H:i:s.v \\U\\T\\C');
    }
    return $a;
}

API Navigation

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