Methods summary
public
|
|
public
array
|
|
public
Nette\DI\Container
|
#
addService( string $name, object $service )
Adds the service to the container.
Adds the service to the container.
Parameters
- $name
string
- $service
object
Returns
|
public
|
#
removeService( string $name )
Removes the service from the container.
Removes the service from the container.
Parameters
|
public
object
|
#
getService( string $name )
Gets the service object by name.
Gets the service object by name.
Parameters
Returns
object
Throws
|
public
boolean
|
#
hasService( string $name )
Does the service exist?
Parameters
Returns
boolean
|
public
boolean
|
#
isCreated( string $name )
Is the service created?
Parameters
Returns
boolean
|
public
object
|
#
createService( string $name, array $args = array() )
Creates new instance of the service.
Creates new instance of the service.
Parameters
- $name
string service name
- $args
Returns
object
Throws
|
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
string[]
|
#
findByType( string $class )
Gets the service names of the specified type.
Gets the service names of the specified type.
Parameters
Returns
string[]
|
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
|
#
callInjects( object $service )
Calls all methods starting with with "inject" using autowiring.
Calls all methods starting with with "inject" using autowiring.
Parameters
|
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
mixed
&
|
#
__get( string $name )
Deprecated
Parameters
- $name
string property name
Returns
mixed property value
Throws
MemberAccessException if the property is not defined.
Overrides
|
public
|
#
__set( string $name, mixed $service )
Deprecated
Parameters
- $name
string property name
- $service
mixed property value
Throws
MemberAccessException if the property is not defined or is read-only
Overrides
|
public
boolean
|
#
__isset( string $name )
Deprecated
Parameters
- $name
string property name
Returns
boolean
Overrides
|
public
|
#
__unset( string $name )
Deprecated
Parameters
- $name
string property name
Throws
MemberAccessException
Overrides
|
public static
|
|