PHP 클래스 Nette\DI\Container

저자: David Grudl
상속: extends Nette\FreezableObject, implements Nette\DI\IContainer
파일 보기 프로젝트 열기: nette/di 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$parameters *private

보호된 프로퍼티들

프로퍼티 타입 설명
$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