You are here

public function RuntimePublicReflectionProperty::setValue in Plug 7

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

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