[DDC-1673] Fixed unused in ProxyFactory.
This commit is contained in:
parent
a47e566382
commit
bf80ee6a30
1 changed files with 11 additions and 4 deletions
|
@ -106,11 +106,16 @@ class ProxyFactory
|
||||||
* Generate the Proxy file name
|
* Generate the Proxy file name
|
||||||
*
|
*
|
||||||
* @param string $className
|
* @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
|
* @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 @@ class ProxyFactory
|
||||||
public function generateProxyClasses(array $classes, $toDir = null)
|
public function generateProxyClasses(array $classes, $toDir = null)
|
||||||
{
|
{
|
||||||
$proxyDir = $toDir ?: $this->_proxyDir;
|
$proxyDir = $toDir ?: $this->_proxyDir;
|
||||||
$proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
|
$proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
/* @var $class ClassMetadata */
|
/* @var $class ClassMetadata */
|
||||||
if ($class->isMappedSuperclass) {
|
if ($class->isMappedSuperclass) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$proxyFileName = $this->getProxyFileName($class->name);
|
$proxyFileName = $this->getProxyFileName($class->name, $proxyDir);
|
||||||
|
|
||||||
$this->_generateProxyClass($class, $proxyFileName, self::$_proxyClassTemplate);
|
$this->_generateProxyClass($class, $proxyFileName, self::$_proxyClassTemplate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue