PHP Класс Nette\DI\ContainerBuilder

Наследование: extends Nette\Object
Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
addAlias ( $alias, $service )
addDefinition ( $name, ServiceDefinition $definition = NULL ) : ServiceDefinition Adds new service definition.
addDependency ( $dep ) : self Adds item to the list of dependencies.
addExcludedClasses ( array $classes ) : self
autowireArguments ( $class, $method, array $arguments ) : array Creates a list of arguments using autowiring.
complete ( ) : void
completeStatement ( Statement $statement ) : Statement
expand ( $value ) : mixed Expands %placeholders% in strings.
findByTag ( $tag ) : array Gets the service objects of the specified tag.
findByType ( $class ) : ServiceDefinition[] Gets the service names and definitions of the specified type.
formatPhp ( $statement, $args )
formatStatement ( Statement $statement )
generateClasses ( $className = 'Container', $parentName = NULL )
getAliases ( ) : array Gets all service aliases.
getByType ( $class ) : string | null Resolves service name by type.
getClassList ( )
getClassName ( )
getDefinition ( $name ) : ServiceDefinition Gets the service definition.
getDefinitions ( ) : ServiceDefinition[] Gets all service definitions.
getDependencies ( ) : array Returns the list of dependencies.
getServiceName ( $arg ) : string Converts @service or @\Class -> service name and checks its existence.
hasDefinition ( $name ) : boolean Does the service definition or alias exist?
literal ( $phpCode ) : Nette\PhpGenerator\PhpLiteral
normalizeEntity ( $entity )
prepareClassList ( ) : array Generates $dependencies, $classes and normalizes class names.
removeAlias ( $alias ) : void Removes the specified alias.
removeDefinition ( $name ) : void Removes the specified service definition.
setClassName ( $name )

Приватные методы

Метод Описание
checkCase ( $class )
resolveEntityClass ( $entity, $recursive = [] ) : string | null
resolveImplement ( ServiceDefinition $def, $name )
resolveServiceClass ( $name, $recursive = [] ) : string | null

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

addAlias() публичный метод

public addAlias ( $alias, $service )

addDefinition() публичный метод

Adds new service definition.
public addDefinition ( $name, ServiceDefinition $definition = NULL ) : ServiceDefinition
$definition ServiceDefinition
Результат ServiceDefinition

addDependency() публичный метод

Adds item to the list of dependencies.
public addDependency ( $dep ) : self
Результат self

addExcludedClasses() публичный метод

public addExcludedClasses ( array $classes ) : self
$classes array
Результат self

autowireArguments() публичный метод

Creates a list of arguments using autowiring.
public autowireArguments ( $class, $method, array $arguments ) : array
$arguments array
Результат array

complete() публичный метод

public complete ( ) : void
Результат void

completeStatement() публичный метод

public completeStatement ( Statement $statement ) : Statement
$statement Statement
Результат Statement

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

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

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

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

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

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

formatPhp() публичный метод

Устаревший:
public formatPhp ( $statement, $args )

formatStatement() публичный метод

Устаревший:
public formatStatement ( Statement $statement )
$statement Statement

generateClasses() публичный метод

Устаревший:
public generateClasses ( $className = 'Container', $parentName = NULL )

getAliases() публичный метод

Gets all service aliases.
public getAliases ( ) : array
Результат array

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

Resolves service name by type.
public getByType ( $class ) : string | null
Результат string | null service name or NULL

getClassList() публичный метод

public getClassList ( )

getClassName() публичный метод

Устаревший:
public getClassName ( )

getDefinition() публичный метод

Gets the service definition.
public getDefinition ( $name ) : ServiceDefinition
Результат ServiceDefinition

getDefinitions() публичный метод

Gets all service definitions.
public getDefinitions ( ) : ServiceDefinition[]
Результат ServiceDefinition[]

getDependencies() публичный метод

Returns the list of dependencies.
public getDependencies ( ) : array
Результат array

getServiceName() публичный метод

Converts @service or @\Class -> service name and checks its existence.
public getServiceName ( $arg ) : string
Результат string of FALSE, if argument is not service name

hasDefinition() публичный метод

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

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

public static literal ( $phpCode ) : Nette\PhpGenerator\PhpLiteral
Результат Nette\PhpGenerator\PhpLiteral

normalizeEntity() публичный метод

public normalizeEntity ( $entity )

prepareClassList() публичный метод

Generates $dependencies, $classes and normalizes class names.
public prepareClassList ( ) : array
Результат array

removeAlias() публичный метод

Removes the specified alias.
public removeAlias ( $alias ) : void
Результат void

removeDefinition() публичный метод

Removes the specified service definition.
public removeDefinition ( $name ) : void
Результат void

setClassName() публичный метод

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

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

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

public array $parameters
Результат array