Class Context
The dependency injection container default implementation.
- Object
-
FreezableObject implements IFreezable
-
Context implements IContext
public
void
|
#
addService(
string
$name,
mixed
$service,
bool
$singleton = true,
array
$options = NULL
)
Adds the specified service to the service container. Adds the specified service to the service container. Parameters$name string service name$service mixed object, class name or factory callback$singleton bool is singleton?$options array factory optionsImplementation of |
public
void
|
#
removeService(
$name
)
Removes the specified service type from the service container. Removes the specified service type from the service container. Implementation of |
public
mixed
|
#
getService(
string
$name,
array
$options = NULL
)
Gets the service object of the specified type. Gets the service object of the specified type. Parameters$name string service name$options array options in case service is not singletonImplementation of |
public
bool
|
#
hasService(
string
$name,
bool
$created = false
)
Exists the service? Exists the service? Parameters$name string service name$created bool must be created?Implementation of |