PHP Class Nette\DI\Container

Author: David Grudl
Inheritance: extends Nette\FreezableObject, implements Nette\DI\IContainer
Afficher le fichier Open project: nette/di Class Usage Examples

Méthodes publiques

Свойство Type Description
$parameters *private

Protected Properties

Свойство Type Description
$meta array[]

Méthodes publiques

Méthode Description
__construct ( array $params = [] )
__get ( $name )
__isset ( $name )
__set ( $name, $service )
__unset ( $name )
addService ( $name, $service ) : self Adds the service to the container.
callInjects ( $service ) : void Calls all methods starting with with "inject" using autowiring.
callMethod ( callable $function, array $args = [] ) : mixed Calls method using autowiring.
createInstance ( $class, array $args = [] ) : object Creates new instance using autowiring.
createService ( $name, array $args = [] ) : object Creates new instance of the service.
expand ( $s ) : mixed Expands %placeholders%.
findByTag ( $tag ) : array Gets the service names of the specified tag.
findByType ( $class ) : string[] Gets the service names of the specified type.
getByType ( $class, $need = TRUE ) : object Resolves service by type.
getMethodName ( $name )
getParameters ( ) : array
getService ( $name ) : object Gets the service object by name.
getServiceType ( $name ) : string Gets the service type by name.
hasService ( $name ) : boolean Does the service exist?
isCreated ( $name ) : boolean Is the service created?
removeService ( $name ) : void Removes the service from the container.

Method Details

__construct() public méthode

public __construct ( array $params = [] )
$params array

__get() public méthode

Deprecation:
public __get ( $name )

__isset() public méthode

Deprecation:
public __isset ( $name )

__set() public méthode

Deprecation:
public __set ( $name, $service )

__unset() public méthode

Deprecation:
public __unset ( $name )

addService() public méthode

Adds the service to the container.
public addService ( $name, $service ) : self
Résultat self

callInjects() public méthode

Calls all methods starting with with "inject" using autowiring.
public callInjects ( $service ) : void
Résultat void

callMethod() public méthode

Calls method using autowiring.
public callMethod ( callable $function, array $args = [] ) : mixed
$function callable
$args array
Résultat mixed

createInstance() public méthode

Creates new instance using autowiring.
public createInstance ( $class, array $args = [] ) : object
$args array
Résultat object

createService() public méthode

Creates new instance of the service.
public createService ( $name, array $args = [] ) : object
$args array
Résultat object

expand() public méthode

Expands %placeholders%.
Deprecation:
public expand ( $s ) : mixed
Résultat mixed

findByTag() public méthode

Gets the service names of the specified tag.
public findByTag ( $tag ) : array
Résultat array of [service name => tag attributes]

findByType() public méthode

Gets the service names of the specified type.
public findByType ( $class ) : string[]
Résultat string[]

getByType() public méthode

Resolves service by type.
public getByType ( $class, $need = TRUE ) : object
Résultat object service or NULL

getMethodName() public static méthode

public static getMethodName ( $name )

getParameters() public méthode

public getParameters ( ) : array
Résultat array

getService() public méthode

Gets the service object by name.
public getService ( $name ) : object
Résultat object

getServiceType() public méthode

Gets the service type by name.
public getServiceType ( $name ) : string
Résultat string

hasService() public méthode

Does the service exist?
public hasService ( $name ) : boolean
Résultat boolean

isCreated() public méthode

Is the service created?
public isCreated ( $name ) : boolean
Résultat boolean

removeService() public méthode

Removes the service from the container.
public removeService ( $name ) : void
Résultat void

Property Details

$meta protected_oe property

protected array[] $meta
Résultat array[]

$parameters public_oe property

*private
public $parameters