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

Breadcrumb

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

function LazyProxyTrait::__unserialize

File

vendor/symfony/var-exporter/LazyProxyTrait.php, line 329

Class

LazyProxyTrait

Namespace

Symfony\Component\VarExporter

Code

public function __unserialize(array $data) : void {
    $class = self::class;
    if ($instance = $data["\x00{$class}\x00lazyObjectReal"] ?? null) {
        unset($data["\x00{$class}\x00lazyObjectReal"]);
        foreach (Registry::$classResetters[$class] ??= Registry::getClassResetters($class) as $reset) {
            $reset($this, $data);
        }
        if ($data) {
            PublicHydrator::hydrate($this, $data);
        }
        $this->lazyObjectState = new LazyObjectState(Registry::$noInitializerState ??= static fn() => throw new \LogicException('Lazy proxy has no initializer.'));
        $this->lazyObjectState->realInstance = $instance;
    }
    elseif ((Registry::$parentMethods[$class] ??= Registry::getParentMethods($class))['unserialize']) {
        parent::__unserialize($data);
    }
    else {
        PublicHydrator::hydrate($this, $data);
        if (Registry::$parentMethods[$class]['wakeup']) {
            parent::__wakeup();
        }
    }
}

API Navigation

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