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

Breadcrumb

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

function LazyGhostTrait::__set

File

vendor/symfony/var-exporter/LazyGhostTrait.php, line 199

Class

LazyGhostTrait

Namespace

Symfony\Component\VarExporter

Code

public function __set($name, $value) : void {
    $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
    $scope = null;
    if ([
        $class,
        ,
        $readonlyScope,
    ] = $propertyScopes[$name] ?? null) {
        $scope = Registry::getScope($propertyScopes, $class, $name, $readonlyScope);
        $state = $this->lazyObjectState ?? null;
        if ($state && ($readonlyScope === $scope || isset($propertyScopes["\x00{$scope}\x00{$name}"])) && LazyObjectState::STATUS_INITIALIZED_FULL !== $state->status) {
            if (LazyObjectState::STATUS_UNINITIALIZED_FULL === $state->status) {
                $state->initialize($this, $name, $readonlyScope ?? $scope);
            }
            goto set_in_scope;
        }
    }
    if ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['set']) {
        parent::__set($name, $value);
        return;
    }
    set_in_scope:
    if (null === $scope) {
        $this->{$name} = $value;
    }
    else {
        $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
        $accessor['set']($this, $name, $value);
    }
}

API Navigation

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