Doctrine\ORM\Proxy\ProxyFactory
This factory is used to create proxy objects for entities at runtime.
- Author: Roman Borschel <roman@code-factory.org>
Synopsis
class ProxyFactory
{
- // constants
- const PATTERN_MATCH_ID_METHOD = '((public\s)?(function\s{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})i';
- // members
- private $_em;
- private $_autoGenerate;
- private $_proxyNamespace;
- private $_proxyDir;
- private string $_proxyClassTemplate;
- // methods
- public void __construct()
- public getProxy()
- private string getProxyFileName()
- public int generateProxyClasses()
- private void _generateProxyClass()
- private string _generateMethods()
- private bool isShortIdentifierGetter()
- private string _generateSleep()
Constants
Name | Value |
---|---|
PATTERN_MATCH_ID_METHOD | '((public\s)?(function\s{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})i' |
Members
private
-
$_autoGenerate
Whether to automatically (re)generate proxy classes. -
$_em
The EntityManager this factory is bound to. -
$_proxyClassTemplate
Proxy class code template -
$_proxyDir
The directory that contains all proxy classes. -
$_proxyNamespace
The namespace that contains all proxy classes.
Methods
private
- _generateMethods() — Generates the methods of a proxy class.
- _generateProxyClass() — Generates a proxy class file.
- _generateSleep() — Generates the code for the __sleep method for a proxy class.
- getProxyFileName() — Generate the Proxy file name
- isShortIdentifierGetter() — Check if the method is a short identifier getter.
public
- __construct() — Initializes a new instance of the <tt>ProxyFactory</tt> class that is connected to the given <tt>EntityManager</tt>.
- generateProxyClasses() — Generates proxy classes for all given classes.
- getProxy() — Gets a reference proxy instance for the entity of the given type and identified by the given identifier.