ContainerBuilder
class ContainerBuilder extends Object
Basic container builder.
Constants
THIS_SERVICE |
|
THIS_CONTAINER |
|
Properties
array | $parameters | ||
string | $currentService | ||
ServiceDefinition[] read-only | $definitions | ||
array read-only | $dependencies |
Methods
Removes the specified service definition.
Gets the service definition.
Gets all service definitions.
Does the service definition exist?
Resolves service name by type.
Gets the service objects of the specified tag.
Creates a list of arguments using autowiring.
Generates $dependencies, $classes and normalizes class names.
No description
Adds a file to the list of dependencies.
Returns the list of dependent files.
Generates PHP classes. First class is the container.
Formats PHP code for class instantiating, function calling or property setting in PHP.
Formats PHP statement.
Expands %placeholders% in strings.
No description
No description
Converts @service or @\Class -> service name and checks its existence.
Details
at line 56
ServiceDefinition
addDefinition($name, ServiceDefinition $definition = NULL)
Adds new service definition.
at line 73
void
removeDefinition($name)
Removes the specified service definition.
at line 84
ServiceDefinition
getDefinition($name)
Gets the service definition.
at line 97
ServiceDefinition[]
getDefinitions()
Gets all service definitions.
at line 108
bool
hasDefinition($name)
Does the service definition exist?
at line 123
string
getByType($class)
Resolves service name by type.
at line 147
array
findByTag($tag)
Gets the service objects of the specified tag.
at line 163
array
autowireArguments($class, $method, array $arguments)
Creates a list of arguments using autowiring.
at line 186
array
prepareClassList()
Generates $dependencies, $classes and normalizes class names.
at line 368
ContainerBuilder
addExcludedClasses(array $classes)
No description
at line 379
ContainerBuilder
addDependency($file)
Adds a file to the list of dependencies.
at line 390
array
getDependencies()
Returns the list of dependent files.
at line 404
ClassType[]
generateClasses($className = 'Container', $parentName = 'Nette\\DI\\Container')
Generates PHP classes. First class is the container.
at line 560
string
formatStatement(Statement $statement)
internal |
Formats PHP code for class instantiating, function calling or property setting in PHP.
at line 624
string
formatPhp($statement, $args)
Formats PHP statement.
at line 667
mixed
expand($value)
Expands %placeholders% in strings.
at line 676
static PhpLiteral
literal($phpCode)
No description
at line 683
normalizeEntity($entity)
internal |
No description
at line 706
string
getServiceName($arg)
Converts @service or @\Class -> service name and checks its existence.