You are here

public function RuntimePublicReflectionProperty::setValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/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

vendor/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);
}