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

Breadcrumb

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

function LazyObjectState::initialize

File

vendor/symfony/var-exporter/Internal/LazyObjectState.php, line 46

Class

LazyObjectState
Keeps the state of lazy objects.

Namespace

Symfony\Component\VarExporter\Internal

Code

public function initialize($instance, $propertyName, $propertyScope) {
    if (self::STATUS_UNINITIALIZED_FULL !== $this->status) {
        return $this->status;
    }
    $this->status = self::STATUS_INITIALIZED_PARTIAL;
    try {
        if ($defaultProperties = array_diff_key(LazyObjectRegistry::$defaultProperties[$instance::class], $this->skippedProperties)) {
            PublicHydrator::hydrate($instance, $defaultProperties);
        }
        ($this->initializer)($instance);
    } catch (\Throwable $e) {
        $this->status = self::STATUS_UNINITIALIZED_FULL;
        $this->reset($instance);
        throw $e;
    }
    return $this->status = self::STATUS_INITIALIZED_FULL;
}

API Navigation

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