PHP Класс Nette\DI\Container

Автор: David Grudl
Наследование: extends Nette\FreezableObject, implements Nette\DI\IContainer
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$parameters *private

Защищенные свойства (Protected)

Свойство Тип Описание
$meta array[]

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

__get() публичный Метод

Устаревший:
public __get ( $name )

__isset() публичный Метод

Устаревший:
public __isset ( $name )

__set() публичный Метод

Устаревший:
public __set ( $name, $service )

__unset() публичный Метод

Устаревший:
public __unset ( $name )

addService() публичный Метод

Adds the service to the container.
public addService ( $name, $service ) : self
Результат self

callInjects() публичный Метод

Calls all methods starting with with "inject" using autowiring.
public callInjects ( $service ) : void
Результат void

callMethod() публичный Метод

Calls method using autowiring.
public callMethod ( callable $function, array $args = [] ) : mixed
$function callable
$args array
Результат mixed

createInstance() публичный Метод

Creates new instance using autowiring.
public createInstance ( $class, array $args = [] ) : object
$args array
Результат object

createService() публичный Метод

Creates new instance of the service.
public createService ( $name, array $args = [] ) : object
$args array
Результат object

expand() публичный Метод

Expands %placeholders%.
Устаревший:
public expand ( $s ) : mixed
Результат mixed

findByTag() публичный Метод

Gets the service names of the specified tag.
public findByTag ( $tag ) : array
Результат array of [service name => tag attributes]

findByType() публичный Метод

Gets the service names of the specified type.
public findByType ( $class ) : string[]
Результат string[]

getByType() публичный Метод

Resolves service by type.
public getByType ( $class, $need = TRUE ) : object
Результат object service or NULL

getMethodName() публичный статический Метод

public static getMethodName ( $name )

getParameters() публичный Метод

public getParameters ( ) : array
Результат array

getService() публичный Метод

Gets the service object by name.
public getService ( $name ) : object
Результат object

getServiceType() публичный Метод

Gets the service type by name.
public getServiceType ( $name ) : string
Результат string

hasService() публичный Метод

Does the service exist?
public hasService ( $name ) : boolean
Результат boolean

isCreated() публичный Метод

Is the service created?
public isCreated ( $name ) : boolean
Результат boolean

removeService() публичный Метод

Removes the service from the container.
public removeService ( $name ) : void
Результат void

Описание свойств

$meta защищенное свойство

protected array[] $meta
Результат array[]

$parameters публичное свойство

*private
public $parameters