You are here

public function AbstractProxyFactory::generateProxyClasses in Plug 7

Generates proxy classes for all given classes.

Parameters

\Doctrine\Common\Persistence\Mapping\ClassMetadata[] $classes The classes (ClassMetadata instances): for which to generate proxies.

string $proxyDir The target directory of the proxy classes. If not specified, the: directory configured on the Configuration of the EntityManager used by this factory is used.

Return value

int Number of generated proxies.

File

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

Class

AbstractProxyFactory
Abstract factory for proxy objects.

Namespace

Doctrine\Common\Proxy

Code

public function generateProxyClasses(array $classes, $proxyDir = null) {
  $generated = 0;
  foreach ($classes as $class) {
    if ($this
      ->skipClass($class)) {
      continue;
    }
    $proxyFileName = $this->proxyGenerator
      ->getProxyFileName($class
      ->getName(), $proxyDir);
    $this->proxyGenerator
      ->generateProxyClass($class, $proxyFileName);
    $generated += 1;
  }
  return $generated;
}