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

Breadcrumb

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

function LazyProxyTrait::__isset

File

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

Class

LazyProxyTrait

Namespace

Symfony\Component\VarExporter

Code

public function __isset($name) : bool {
    $propertyScopes = Hydrator::$propertyScopes[$this::class] ??= Hydrator::getPropertyScopes($this::class);
    $scope = null;
    $instance = $this;
    if ([
        $class,
    ] = $propertyScopes[$name] ?? null) {
        $scope = Registry::getScope($propertyScopes, $class, $name);
        if (null === $scope || isset($propertyScopes["\x00{$scope}\x00{$name}"])) {
            if ($state = $this->lazyObjectState ?? null) {
                $instance = $state->realInstance ??= ($state->initializer)();
            }
            goto isset_in_scope;
        }
    }
    if ($state = $this->lazyObjectState ?? null) {
        $instance = $state->realInstance ??= ($state->initializer)();
    }
    elseif ((Registry::$parentMethods[self::class] ??= Registry::getParentMethods(self::class))['isset']) {
        return parent::__isset($name);
    }
    isset_in_scope:
    if (null === $scope) {
        return isset($instance->{$name});
    }
    $accessor = Registry::$classAccessors[$scope] ??= Registry::getClassAccessors($scope);
    return $accessor['isset']($instance, $name);
}

API Navigation

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