You are here

public function RuntimePublicReflectionProperty::setValue in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_annotation_discovery/lib/Doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php \Doctrine\Common\Reflection\RuntimePublicReflectionProperty::setValue()

Avoids triggering lazy loading via `__set` if the provided object is a {@link https://bugs.php.net/bug.php?id=63463

See also

\Doctrine\Common\Proxy\Proxy}.

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/common/lib/Doctrine/Common/Reflection/RuntimePublicReflectionProperty.php, line 63

Class

RuntimePublicReflectionProperty
PHP Runtime Reflection Public Property - special overrides for public properties.

Namespace

Doctrine\Common\Reflection

Code

public function setValue($object, $value = null) {
  if (!($object instanceof Proxy && !$object
    ->__isInitialized())) {
    parent::setValue($object, $value);
    return;
  }
  $originalInitializer = $object
    ->__getInitializer();
  $object
    ->__setInitializer(null);
  parent::setValue($object, $value);
  $object
    ->__setInitializer($originalInitializer);
}