Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • None
  • PHP

Classes

  • DIContainer
  • DIContainerBuilder
  • DIHelpers
  • DIServiceDefinition
  • DIStatement

Interfaces

  • IDIContainer

Exceptions

  • MissingServiceException
  • ServiceCreationException
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class DIContainerBuilder

Basic container builder.

Object
Extended by DIContainerBuilder
Package: Nette\DI
Author: David Grudl
Located at DI/ContainerBuilder.php
Methods summary
public DIServiceDefinition
# addDefinition( string $name )

Adds new service definition. The expressions %param% and @service will be expanded.

Adds new service definition. The expressions %param% and @service will be expanded.

Parameters

$name
string

Returns

DIServiceDefinition
public
# removeDefinition( string $name )

Removes the specified service definition.

Removes the specified service definition.

Parameters

$name
string
public DIServiceDefinition
# getDefinition( string $name )

Gets the service definition.

Gets the service definition.

Parameters

$name
string

Returns

DIServiceDefinition
public array
# getDefinitions( )

Gets all service definitions.

Gets all service definitions.

Returns

array
public boolean
# hasDefinition( string $name )

Does the service definition exist?

Does the service definition exist?

Parameters

$name
string

Returns

boolean
public string
# getByType( string $class )

Resolves service name by type.

Resolves service name by type.

Parameters

$class
string
class or interface

Returns

string
service name or NULL

Throws

ServiceCreationException
public array
# findByTag( string $tag )

Gets the service objects of the specified tag.

Gets the service objects of the specified tag.

Parameters

$tag
string

Returns

array
of [service name => tag attributes]
public array
# autowireArguments( $class, $method, array $arguments )

Creates a list of arguments using autowiring.

Creates a list of arguments using autowiring.

Returns

array
public array
# prepareClassList( )

Generates $dependencies, $classes and expands and normalize class names.

Generates $dependencies, $classes and expands and normalize class names.

Returns

array
public DIContainerBuilder
# addDependency( $file )

Adds a file to the list of dependencies.

Adds a file to the list of dependencies.

Returns

DIContainerBuilder
provides a fluent interface
public array
# getDependencies( )

Returns the list of dependent files.

Returns the list of dependent files.

Returns

array
public PhpClassType
# generateClass( $parentClass = 'DIContainer' )

Generates PHP class.

Generates PHP class.

Returns

PhpClassType
public string
# formatPhp( $statement, $args, $self = NULL )

Formats PHP statement.

Formats PHP statement.

Returns

string
public mixed
# expand( mixed $value )

Expands %placeholders% in strings (recursive).

Expands %placeholders% in strings (recursive).

Parameters

$value
mixed

Returns

mixed
public string
# getServiceName( mixed $arg, $self = NULL )

Converts @service or @Class -> service name and checks its existence.

Converts @service or @Class -> service name and checks its existence.

Parameters

$arg
mixed
$self

Returns

string
of FALSE, if argument is not service name
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string CREATED_SERVICE 'self'
#
string THIS_CONTAINER 'container'
#
Properties summary
public array $parameters array()
#

%param% will be expanded

%param% will be expanded

Magic properties summary
public read-only array $dependencies
#
Magic properties inherited from Object
$reflection
Nette Framework 2.0.8 (for PHP 5.2, un-prefixed) API API documentation generated by ApiGen 2.8.0