You are here

private function AbstractProxyFactory::getProxyDefinition in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php \Doctrine\Common\Proxy\AbstractProxyFactory::getProxyDefinition()

Get a proxy definition for the given class name.

Parameters

string $className:

Return value

ProxyDefinition

2 calls to AbstractProxyFactory::getProxyDefinition()
AbstractProxyFactory::getProxy in vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
Gets a reference proxy instance for the entity of the given type and identified by the given identifier.
AbstractProxyFactory::resetUninitializedProxy in vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php
Reset initialization/cloning logic for an un-initialized proxy

File

vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php, line 196

Class

AbstractProxyFactory
Abstract factory for proxy objects.

Namespace

Doctrine\Common\Proxy

Code

private function getProxyDefinition($className) {
  $classMetadata = $this->metadataFactory
    ->getMetadataFor($className);
  $className = $classMetadata
    ->getName();

  // aliases and case sensitivity
  $this->definitions[$className] = $this
    ->createProxyDefinition($className);
  $proxyClassName = $this->definitions[$className]->proxyClassName;
  if (!class_exists($proxyClassName, false)) {
    $fileName = $this->proxyGenerator
      ->getProxyFileName($className);
    switch ($this->autoGenerate) {
      case self::AUTOGENERATE_NEVER:
        require $fileName;
        break;
      case self::AUTOGENERATE_FILE_NOT_EXISTS:
        if (!file_exists($fileName)) {
          $this->proxyGenerator
            ->generateProxyClass($classMetadata, $fileName);
        }
        require $fileName;
        break;
      case self::AUTOGENERATE_ALWAYS:
        $this->proxyGenerator
          ->generateProxyClass($classMetadata, $fileName);
        require $fileName;
        break;
      case self::AUTOGENERATE_EVAL:
        $this->proxyGenerator
          ->generateProxyClass($classMetadata, false);
        break;
    }
  }
  return $this->definitions[$className];
}