ProxyFactory
in package
Creates proxy classes.
Wraps Ocramius/ProxyManager LazyLoadingValueHolderFactory.
Tags
Table of Contents
Properties
- $proxyDirectory : string|null
- $proxyManager : LazyLoadingValueHolderFactory|null
Methods
- __construct() : mixed
- createProxy() : LazyLoadingInterface
- Creates a new lazy proxy instance of the given class with the given initializer.
- generateProxyClass() : void
- Generates and writes the proxy class to file.
- proxyManager() : LazyLoadingValueHolderFactory
Properties
$proxyDirectory
private
string|null
$proxyDirectory
= null
$proxyManager
private
LazyLoadingValueHolderFactory|null
$proxyManager
= null
Methods
__construct()
public
__construct([string|null $proxyDirectory = null ]) : mixed
Parameters
- $proxyDirectory : string|null = null
-
If set, write the proxies to disk in this directory to improve performances.
createProxy()
Creates a new lazy proxy instance of the given class with the given initializer.
public
createProxy(class-string $className, Closure $initializer) : LazyLoadingInterface
Parameters
- $className : class-string
-
name of the class to be proxied
- $initializer : Closure
-
initializer to be passed to the proxy
Return values
LazyLoadingInterfacegenerateProxyClass()
Generates and writes the proxy class to file.
public
generateProxyClass(class-string $className) : void
Parameters
- $className : class-string
-
name of the class to be proxied
proxyManager()
private
proxyManager() : LazyLoadingValueHolderFactory