Methods summary
public
|
|
public
array
|
|
public
Nette\DI\Container
|
#
addService( string $name, mixed $service, array $meta = NULL )
Adds the service or service factory to the container.
Adds the service or service factory to the container.
Parameters
- $name
string
- $service
mixed object, class name or callable
- $meta
array service meta information
Returns
Implementation of
|
public
|
#
removeService( string $name )
Removes the service from the container.
Removes the service from the container.
Parameters
Implementation of
|
public
object
|
#
getService( string $name )
Gets the service object by name.
Gets the service object by name.
Parameters
Returns
object
Implementation of
|
public
boolean
|
#
hasService( string $name )
Does the service exist?
Parameters
Returns
boolean
Implementation of
|
public
boolean
|
#
isCreated( string $name )
Is the service created?
Parameters
Returns
boolean
|
public
object
|
#
getByType( string $class, boolean $need = TRUE )
Resolves service by type.
Resolves service by type.
Parameters
- $class
string class or interface
- $need
boolean throw exception if service doesn't exist?
Returns
object service or NULL
Throws
|
public
array
|
#
findByTag( string $tag )
Gets the service names of the specified tag.
Gets the service names of the specified tag.
Parameters
Returns
array of [service name => tag attributes]
|
public
object
|
#
createInstance( string $class, array $args = array() )
Creates new instance using autowiring.
Creates new instance using autowiring.
Parameters
- $class
string class
- $args
array arguments
Returns
object
Throws
|
public
mixed
|
#
callMethod( mixed $function, array $args = array() )
Calls method using autowiring.
Calls method using autowiring.
Parameters
- $function
mixed class, object, function, callable
- $args
array arguments
Returns
mixed
|
public
mixed
|
#
expand( mixed $s )
Expands %placeholders%.
Parameters
Returns
mixed
|
public
object
&
|
#
__get( string $name )
Gets the service object, shortcut for getService().
Gets the service object, shortcut for getService().
Parameters
Returns
object
Throws
MemberAccessException if the property is not defined.
Overrides
|
public
|
#
__set( string $name, object $service )
Adds the service object.
Parameters
- $name
string
- $service
object
Throws
MemberAccessException if the property is not defined or is read-only
Overrides
|
public
boolean
|
#
__isset( string $name )
Does the service exist?
Parameters
Returns
boolean
Overrides
|
public
|
#
__unset( string $name )
Removes the service, shortcut for removeService().
Removes the service, shortcut for removeService().
Parameters
- $name
string property name
Throws
MemberAccessException
Overrides
|
public static
|
|