Documentation

ResettableContainerTrait

Extends a Di\Container to allow for introspection and resetting.

Table of Contents

Methods

initialized()  : bool
Test if the entry given by $name has been initialized in the container.
reset()  : void
Unset the entry given by $name in the container.

Methods

initialized()

Test if the entry given by $name has been initialized in the container.

public initialized(string $name) : bool
Parameters
$name : string

Entry name or a class name.

Return values
bool

Whether or not the entry is initialized.

reset()

Unset the entry given by $name in the container.

public reset(string $name) : void

A subsequent call to get() will create a new instance of this entry, according to its definition (if it has one). This can be useful to release resources that are no longer in use or that need to be reset.

Parameters
$name : string

Entry name or a class name.


        
On this page

Search results