Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Class: Swift_DependencyContainer

Source Location: /system/vendor/swiftmailer/swiftmailer/lib/classes/Swift/DependencyContainer.php

Class Overview


Dependency Injection container.


Author(s):

  • Chris Corbyn

Constants

Methods



Class Details

[line 16]
Dependency Injection container.



Tags:

author:  Chris Corbyn


[ Top ]


Class Methods


static method getInstance [line 53]

static Swift_DependencyContainer getInstance( )

Returns a singleton of the DependencyContainer.



Tags:

access:  public


[ Top ]

constructor __construct [line 44]

Swift_DependencyContainer __construct( )

Constructor should not be used.

Use getInstance() instead.




Tags:

access:  public


[ Top ]

method addConstructorLookup [line 283]

Swift_DependencyContainer addConstructorLookup( string $lookup)

Specify a dependency lookup for the constructor of the previously registered item.



Tags:



Parameters:

string   $lookup  

[ Top ]

method addConstructorValue [line 262]

Swift_DependencyContainer addConstructorValue( mixed $value)

Specify a literal (non looked up) value for the constructor of the previously registered item.



Tags:



Parameters:

mixed   $value  

[ Top ]

method asAliasOf [line 181]

Swift_DependencyContainer asAliasOf( string $lookup)

Specify the previously registered item as an alias of another item.



Tags:

access:  public


Parameters:

string   $lookup  

[ Top ]

method asNewInstanceOf [line 203]

Swift_DependencyContainer asNewInstanceOf( string $className)

Specify the previously registered item as a new instance of $className.

register() must be called before this will work. Any arguments can be set with withDependencies(), addConstructorValue() or addConstructorLookup().




Tags:



Parameters:

string   $className  

[ Top ]

method asSharedInstanceOf [line 221]

Swift_DependencyContainer asSharedInstanceOf( string $className)

Specify the previously registered item as a shared instance of $className.

register() must be called before this will work.




Tags:

access:  public


Parameters:

string   $className  

[ Top ]

method asValue [line 165]

Swift_DependencyContainer asValue( mixed $value)

Specify the previously registered item as a literal value.

register() must be called before this will work.




Tags:

access:  public


Parameters:

mixed   $value  

[ Top ]

method createDependenciesFor [line 125]

array createDependenciesFor( string $itemName)

Create an array of arguments passed to the constructor of $itemName.



Tags:

access:  public


Parameters:

string   $itemName  

[ Top ]

method has [line 81]

bool has( string $itemName)

Test if an item is registered in this container with the given name.



Tags:

see:  Swift_DependencyContainer::register()
access:  public


Parameters:

string   $itemName  

[ Top ]

method listItems [line 67]

array listItems( )

List the names of all items stored in the Container.



Tags:

access:  public


[ Top ]

method lookup [line 98]

mixed lookup( string $itemName)

Lookup the item with the given $itemName.



Tags:

see:  Swift_DependencyContainer::register()
throws:  Swift_DependencyException If the dependency is not found
access:  public


Parameters:

string   $itemName  

[ Top ]

method register [line 148]

Swift_DependencyContainer register( string $itemName)

Register a new dependency with $itemName.

This method returns the current DependencyContainer instance because it requires the use of the fluid interface to set the specific details for the dependency.




Tags:



Parameters:

string   $itemName  

[ Top ]

method withDependencies [line 241]

Swift_DependencyContainer withDependencies( $lookups)

Specify a list of injected dependencies for the previously registered item.

This method takes an array of lookup names.




Tags:



Parameters:

array   $lookups  

[ Top ]


Class Constants

TYPE_ALIAS =  0x1000

[line 28]

Constant for aliases


[ Top ]

TYPE_INSTANCE =  0x0010

[line 22]

Constant for new instance types


[ Top ]

TYPE_SHARED =  0x0100

[line 25]

Constant for shared instance types


[ Top ]

TYPE_VALUE =  0x0001

[line 19]

Constant for literal value types


[ Top ]



Documentation generated on Sun, 02 Oct 2016 07:47:24 +0000 by phpDocumentor 1.4.3