Doctrine


Doctrine\ORM\Proxy\ProxyFactory
/Doctrine/ORM/Proxy/ProxyFactory.php at line 35

Class ProxyFactory

ProxyFactory

public class ProxyFactory

This factory is used to create proxy objects for entities at runtime.

Author:
Roman Borschel
Giorgio Sironi
Since:
2.0

Constructor Summary

ProxyFactory(EntityManager em, string proxyDir, string proxyNs, boolean autoGenerate)

Initializes a new instance of the ProxyFactory class that is connected to the given EntityManager.

Method Summary
void

generateProxyClasses(array classes, string toDir)

Generates proxy classes for all given classes.

object

getProxy(string className, mixed identifier)

Gets a reference proxy instance for the entity of the given type and identified by the given identifier.

Constructor Detail

/Doctrine/ORM/Proxy/ProxyFactory.php at line 55

ProxyFactory

public ProxyFactory(EntityManager em, string proxyDir, string proxyNs, boolean autoGenerate)

Initializes a new instance of the ProxyFactory class that is connected to the given EntityManager.

Parameters:
em - The EntityManager the new factory works for.
proxyDir - The directory to use for the proxy classes. It must exist.
proxyNs - The namespace to use for the proxy classes.
autoGenerate - Whether to automatically generate proxy classes.

Method Detail

/Doctrine/ORM/Proxy/ProxyFactory.php at line 105

generateProxyClasses

public void generateProxyClasses(array classes, string toDir)

Generates proxy classes for all given classes.

Parameters:
classes - The classes (ClassMetadata instances) for which to generate proxies.
toDir - 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.

/Doctrine/ORM/Proxy/ProxyFactory.php at line 77

getProxy

public object getProxy(string className, mixed identifier)

Gets a reference proxy instance for the entity of the given type and identified by the given identifier.


Doctrine