| Methods |
public
|
__construct(ProxyGenerator $proxyGenerator, ClassMetadataFactory $metadataFactory, bool|int $autoGenerate)
|
#
|
public
|
getProxy(string $className, array<mixed> $identifier): Proxy
Gets a reference proxy instance for the entity of the given type and identified by
the given identifier.
Gets a reference proxy instance for the entity of the given type and identified by
the given identifier.
Throws
Overriden by
|
#
|
public
|
generateProxyClasses(ClassMetadata[] $classes, string $proxyDir = null): int
Generates proxy classes for all given classes.
Generates proxy classes for all given classes.
Parameters
| $classes |
The classes (ClassMetadata instances)
for which to generate proxies.
|
| $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.
|
Returns
Number of generated proxies.
|
#
|
public
|
resetUninitializedProxy(Proxy $proxy): Proxy
Reset initialization/cloning logic for an un-initialized proxy
Reset initialization/cloning logic for an un-initialized proxy
Throws
|
#
|
private
|
getProxyDefinition(class-string $className): ProxyDefinition
Get a proxy definition for the given class name.
Get a proxy definition for the given class name.
|
#
|
abstract
protected
|
skipClass(ClassMetadata $metadata): bool
Determine if this class should be skipped during proxy generation.
Determine if this class should be skipped during proxy generation.
Implemented by
|
#
|
abstract
protected
|
createProxyDefinition(class-string $className): ProxyDefinition
|
#
|
| Constants |
public
|
AUTOGENERATE_NEVER = 0
Never autogenerate a proxy and rely that it was generated by some
process before deployment.
Never autogenerate a proxy and rely that it was generated by some
process before deployment.
|
#
|
public
|
AUTOGENERATE_ALWAYS = 1
Always generates a new proxy in every request.
Always generates a new proxy in every request.
This is only sane during development.
|
#
|
public
|
AUTOGENERATE_FILE_NOT_EXISTS = 2
Autogenerate the proxy class when the proxy file does not exist.
Autogenerate the proxy class when the proxy file does not exist.
This strategy causes a file_exists() call whenever any proxy is used the
first time in a request.
|
#
|
public
|
AUTOGENERATE_EVAL = 3
Generate the proxy classes using eval().
Generate the proxy classes using eval().
This strategy is only sane for development, and even then it gives me
the creeps a little.
|
#
|
public
|
AUTOGENERATE_FILE_NOT_EXISTS_OR_CHANGED = 4
Autogenerate the proxy class when the proxy file does not exist or
when the proxied file changed.
Autogenerate the proxy class when the proxy file does not exist or
when the proxied file changed.
This strategy causes a file_exists() call whenever any proxy is used the
first time in a request. When the proxied file is changed, the proxy will
be updated.
|
#
|
private
|
AUTOGENERATE_MODES = [
self::AUTOGENERATE_NEVER,
self::AUTOGENERATE_ALWAYS,
self::AUTOGENERATE_FILE_NOT_EXISTS,
self::AUTOGENERATE_EVAL,
self::AUTOGENERATE_FILE_NOT_EXISTS_OR_CHANGED,
]
|
#
|