public function getProxy($className, array $identifier)
    {
        $definition = isset($this->definitions[$className])
            ? $this->definitions[$className]
            : $this->getProxyDefinition($className);
        $fqcn       = $definition->proxyClassName;
        $proxy      = new $fqcn($definition->initializer, $definition->cloner);

        foreach ($definition->identifierFields as $idField) {
            if ( ! isset($identifier[$idField])) {
                throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField);
            }

            $definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]);
        }

        return $proxy;
    }
public function getProxy($className, array $identifier)
    {
        $definition = isset($this->definitions[$className])
            ? $this->definitions[$className]
            : $this->getProxyDefinition($className);
        $fqcn       = $definition->proxyClassName;
        $proxy      = new $fqcn($definition->initializer, $definition->cloner);

        foreach ($definition->identifierFields as $idField) {
            if ( ! isset($identifier[$idField])) {
                throw OutOfBoundsException::missingPrimaryKeyValue($className, $idField);
            }

            $definition->reflectionFields[$idField]->setValue($proxy, $identifier[$idField]);
        }

        return $proxy;
    }
public function getProxy ( $ className , array $ identifier ) { $ definition = isset ( $ this -> definitions [ $ className ] ) ? $ this -> definitions [ $ className ] : $ this -> getProxyDefinition ( $ className ) ; $ fqcn = $ definition -> proxyClassName ; $ proxy = new $ fqcn ( $ definition -> initializer , $ definition -> cloner ) ; foreach ( $ definition -> identifierFields as $ idField ) { if ( ! isset ( $ identifier [ $ idField ] ) ) { throw OutOfBoundsException :: missingPrimaryKeyValue ( $ className , $ idField ) ; } $ definition -> reflectionFields [ $ idField ] -> setValue ( $ proxy , $ identifier [ $ idField ] ) ; } return $ proxy ; }
Gets a reference proxy instance for the entity of the given type and identified by
the given identifier.

@param  string $className
@param  array  $identifier

@return \Doctrine\Common\Proxy\Proxy

@throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException
Gets a reference proxy instance for the entity of the given type and identified by the given identifier .