Doctrine\OXM\Proxy\ProxyFactory::generateProxyClasses PHP Method

generateProxyClasses() public method

Generates proxy classes for all given classes.
public generateProxyClasses ( array $classes, string $toDir = null )
$classes array The classes (ClassMetadata instances) for which to generate proxies.
$toDir string The target directory of the proxy classes. If not specified, the directory configured on the Configuration of the DocumentManager used by this factory is used.
    public function generateProxyClasses(array $classes, $toDir = null)
    {
        $proxyDir = $toDir ?: $this->proxyDir;
        $proxyDir = rtrim($proxyDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        foreach ($classes as $class) {
            $proxyClassName = str_replace('\\', '', $class->name) . 'Proxy';
            $proxyFileName = $proxyDir . $proxyClassName . '.php';
            $this->generateProxyClass($class, $proxyClassName, $proxyFileName, self::$proxyClassTemplate);
        }
    }