public function AbstractProxyFactory::resetUninitializedProxy in Plug 7
Reset initialization/cloning logic for an un-initialized proxy
Parameters
\Doctrine\Common\Proxy\Proxy $proxy:
Return value
Throws
\Doctrine\Common\Proxy\Exception\InvalidArgumentException
File
- lib/
doctrine/ common/ lib/ Doctrine/ Common/ Proxy/ AbstractProxyFactory.php, line 172
Class
- AbstractProxyFactory
- Abstract factory for proxy objects.
Namespace
Doctrine\Common\ProxyCode
public function resetUninitializedProxy(Proxy $proxy) {
if ($proxy
->__isInitialized()) {
throw InvalidArgumentException::unitializedProxyExpected($proxy);
}
$className = ClassUtils::getClass($proxy);
$definition = isset($this->definitions[$className]) ? $this->definitions[$className] : $this
->getProxyDefinition($className);
$proxy
->__setInitializer($definition->initializer);
$proxy
->__setCloner($definition->cloner);
return $proxy;
}