Menu

## ProxyFactory
in package

ProxyFactory.php : 24

Creates proxy classes.

Wraps Ocramius/ProxyManager LazyLoadingValueHolderFactory.

##### Tags

see
  LazyLoadingValueHolderFactory
since
  5.0
author

  Matthieu Napoli matthieu@mnapoli.fr

### 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

ProxyFactory.php : 32
`private string|null $proxyDirectory = null`

#### $proxyManager

ProxyFactory.php : 26
`private LazyLoadingValueHolderFactory|null $proxyManager = null`

### Methods

#### __construct()

ProxyFactory.php : 31
`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()

ProxyFactory.php : 43

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

LazyLoadingInterface

#### generateProxyClass()

ProxyFactory.php : 53

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()

ProxyFactory.php : 62
`private proxyManager() : LazyLoadingValueHolderFactory`

##### Return values

LazyLoadingValueHolderFactory

## Search results