PHP Class Doctrine\ODM\CouchDB\Proxy\ProxyFactory

Author: Roman Borschel ([email protected])
Author: Giorgio Sironi ([email protected])
Mostrar archivo Open project: doctrine/couchdb-odm Class Usage Examples

Public Methods

Method Description
__construct ( DocumentManager $dm, 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 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, $fileName, $template ) Generates a proxy class file.
generateSleep ( ClassMetadata $class ) : string Generates the code for the __sleep method for a proxy class.
getProxyFileName ( string $className, string $baseDir = null ) : string Generate the Proxy file name

Method Details

__construct() public method

Initializes a new instance of the ProxyFactory class that is connected to the given DocumentManager.
public __construct ( DocumentManager $dm, string $proxyDir, string $proxyNs, boolean $autoGenerate = false )
$dm Doctrine\ODM\CouchDB\DocumentManager The DocumentManager 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 entity of the given type and identified by the given identifier.
public getProxy ( string $className, mixed $identifier ) : object
$className string
$identifier mixed
return object