class FactoryEntry implements EntryInterface (View source)

Provides a wrapper for other entries to disallow caching of returned values.

Methods

__construct(EntryInterface $type)

FactoryType constructor.

static EntryInterface
createFromCacheParameters(array $parameters)

Initializes the entry from the given container cache parameters.

array
getCacheParameters()

Returns the container cache parameters for the entry.

bool
isFactory()

Tells if we should not cache the value because the entry is a factory.

mixed
getValue(ContainerInterface $container)

Returns the value for the container entry.

Details

__construct(EntryInterface $type)

FactoryType constructor.

Parameters

EntryInterface $type The actual container entry used to determine the value

static EntryInterface createFromCacheParameters(array $parameters)

Initializes the entry from the given container cache parameters.

Parameters

array $parameters The container cache parameters for the entry

Return Value

EntryInterface The initialized container entry

array getCacheParameters()

Returns the container cache parameters for the entry.

Return Value

array The container cache parameters for the entry

Exceptions

ContainerException If the entry cannot be cached

bool isFactory()

Tells if we should not cache the value because the entry is a factory.

Return Value

bool True if the entry is factory and the value should not be cached, false otherwise

mixed getValue(ContainerInterface $container)

Returns the value for the container entry.

Parameters

ContainerInterface $container Container used to resolve dependencies

Return Value

mixed The value for the container entry

Exceptions

NotFoundExceptionInterface If trying to use dependencies that do not exist
ContainerExceptionInterface If there are errors trying to load dependencies