PHP Class Doctrine\OXM\Proxy\ProxyFactory

Since: 1.0
Author: Igor Golovanov ([email protected])
Datei anzeigen Open project: doctrine/oxm

Public Methods

Method Description
__construct ( XmlEntityManager $xem, string $proxyDir, string $proxyNs, boolean $autoGenerate = false ) Initializes a new instance of the ProxyFactory class that is connected to the given DocumentManager.
generateProxyClasses ( array $classes, string $toDir = null ) Generates proxy classes for all given classes.
getProxy ( string $className, mixed $identifier ) : object Gets a reference proxy instance for the xml-entity of the given type and identified by the given identifier.

Private Methods

Method Description
generateMethods ( ClassMetadata $class ) : string Generates the methods of a proxy class.
generateProxyClass ( $class, $proxyClassName, $fileName, $file ) Generates a proxy class file.
generateSleep ( ClassMetadata $class ) : string Generates the code for the __sleep method for a proxy class.

Method Details

__construct() public method

Initializes a new instance of the ProxyFactory class that is connected to the given DocumentManager.
public __construct ( XmlEntityManager $xem, string $proxyDir, string $proxyNs, boolean $autoGenerate = false )
$xem Doctrine\OXM\XmlEntityManager The XmlEntityManager the new factory works for.
$proxyDir string The directory to use for the proxy classes. It must exist.
$proxyNs string The namespace to use for the proxy classes.
$autoGenerate boolean Whether to automatically generate proxy classes.

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.

getProxy() public method

Gets a reference proxy instance for the xml-entity of the given type and identified by the given identifier.
public getProxy ( string $className, mixed $identifier ) : object
$className string
$identifier mixed
return object