Documentation

ObjectCreator
in package
implements DefinitionResolver

Create objects based on an object definition.

Tags
template-implements
since
4.0
author

Matthieu Napoli matthieu@mnapoli.fr

Table of Contents

Interfaces

DefinitionResolver
Resolves a definition to a value.

Properties

$definitionResolver  : DefinitionResolver
$parameterResolver  : ParameterResolver
$proxyFactory  : ProxyFactory

Methods

__construct()  : mixed
isResolvable()  : bool
The definition is not resolvable if the class is not instantiable (interface or abstract) or if the class doesn't exist.
resolve()  : mixed
Resolve a class definition to a value.
setPrivatePropertyValue()  : void
injectMethodsAndProperties()  : void
createInstance()  : object
Creates an instance of the class and injects dependencies.
createProxy()  : LazyLoadingInterface
Returns a proxy instance.
injectProperty()  : void
Inject dependencies into properties.

Properties

Methods

isResolvable()

The definition is not resolvable if the class is not instantiable (interface or abstract) or if the class doesn't exist.

public isResolvable(ObjectDefinition $definition[, array<string|int, mixed> $parameters = [] ]) : bool
Parameters
$definition : ObjectDefinition
$parameters : array<string|int, mixed> = []

Optional parameters to use to build the entry.

Return values
bool

resolve()

Resolve a class definition to a value.

public resolve(ObjectDefinition $definition[, array<string|int, mixed> $parameters = [] ]) : mixed

This will create a new instance of the class using the injections points defined.

Parameters
$definition : ObjectDefinition
$parameters : array<string|int, mixed> = []

Optional parameters to use to build the entry.

Return values
mixed

Value obtained from the definition.

setPrivatePropertyValue()

public static setPrivatePropertyValue(string|null $className, mixed $object, string $propertyName, mixed $propertyValue) : void
Parameters
$className : string|null
$object : mixed
$propertyName : string
$propertyValue : mixed

createProxy()

Returns a proxy instance.

private createProxy(ObjectDefinition $definition, array<string|int, mixed> $parameters) : LazyLoadingInterface
Parameters
$definition : ObjectDefinition
$parameters : array<string|int, mixed>
Return values
LazyLoadingInterface

        
On this page

Search results