Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DDC-1673] Fixed unused in ProxyFactory.

  • Loading branch information...
commit bf80ee6a30f04aed406a3253ef7459b4fcf11bda 1 parent a47e566
@guilhermeblanco guilhermeblanco authored
Showing with 11 additions and 4 deletions.
  1. +11 −4 lib/Doctrine/ORM/Proxy/ProxyFactory.php
View
15 lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -106,11 +106,16 @@ public function getProxy($className, $identifier)
* Generate the Proxy file name
*
* @param string $className
+ * @param string $baseDir Optional base directory for proxy file name generation.
+ * If not specified, the directory configured on the Configuration of the
+ * EntityManager will be used by this factory.
* @return string
*/
- private function getProxyFileName($className)
+ private function getProxyFileName($className, $baseDir = null)
{
- return $this->_proxyDir . DIRECTORY_SEPARATOR . '__CG__' . str_replace('\\', '', $className) . '.php';
+ $proxyDir = $baseDir ?: $this->_proxyDir;
+
+ return $proxyDir . DIRECTORY_SEPARATOR . '__CG__' . str_replace('\\', '', $className) . '.php';
}
/**
@@ -124,14 +129,16 @@ private function getProxyFileName($className)
public function generateProxyClasses(array $classes, $toDir = null)
{
$proxyDir = $toDir ?: $this->_proxyDir;
- $proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+ $proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR);
+
foreach ($classes as $class) {
/* @var $class ClassMetadata */
if ($class->isMappedSuperclass) {
continue;
}
- $proxyFileName = $this->getProxyFileName($class->name);
+ $proxyFileName = $this->getProxyFileName($class->name, $proxyDir);
+
$this->_generateProxyClass($class, $proxyFileName, self::$_proxyClassTemplate);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.