## Class Swift_DependencyContainer

(line 18)

## Description

Located in File: /vendors/swiftMailer/classes/Swift/DependencyContainer.php

##### Dependency Injection container.

- author: - Chris Corbyn

## Class Variables

Summary:

## Class Constants

Summary:
TYPE_ALIAS
TYPE_INSTANCE
TYPE_SHARED
TYPE_VALUE

#### TYPE_ALIAS = 0x1000 (line 31)

##### Constant for aliases

#### TYPE_INSTANCE = 0x0010 (line 25)

##### Constant for new instance types

#### TYPE_SHARED = 0x0100 (line 28)

##### Constant for shared instance types

#### TYPE_VALUE = 0x0001 (line 22)

##### Constant for literal value types

## Method Detail

Summary:
static Swift_DependencyContainer getInstance ()
Swift_DependencyContainer __construct ()
Swift_DependencyContainer addConstructorLookup (string $lookup)
Swift_DependencyContainer addConstructorValue (mixed $value)
Swift_DependencyContainer asAliasOf (string $lookup)
Swift_DependencyContainer asNewInstanceOf (string $className)
Swift_DependencyContainer asSharedInstanceOf (string $className)
Swift_DependencyContainer asValue (mixed $value)
array createDependenciesFor (string $itemName)
boolean has (string $itemName)
array listItems ()
mixed lookup (string $itemName)
Swift_DependencyContainer register (string $itemName)
Swift_DependencyContainer withDependencies ( $lookups)

#### Static Method getInstance (line 52)

#### Swift_DependencyContainer getInstance( )

##### Returns a singleton of the DependencyContainer.

#### Info

- access - public

#### Constructor __construct (line 46)

#### Swift_DependencyContainer __construct( )

##### Constructor should not be used.

Use getInstance() instead.

#### Info

- access - public

#### Method addConstructorLookup (line 249)

#### Swift_DependencyContainer addConstructorLookup( string $lookup)

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

#### Parameters

- string $lookup:

#### Info

- see - Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue()
- access - public

#### Method addConstructorValue (line 230)

#### Swift_DependencyContainer addConstructorValue( mixed $value)

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

#### Parameters

- mixed $value:

#### Info

- see - Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorLookup()
- access - public

#### Method asAliasOf (line 163)

#### Swift_DependencyContainer asAliasOf( string $lookup)

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

#### Parameters

- string $lookup:

#### Info

- access - public

#### Method asNewInstanceOf (line 181)

#### 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().

#### Parameters

- string $className:

#### Info

- see - Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
- access - public

#### Method asSharedInstanceOf (line 195)

#### Swift_DependencyContainer asSharedInstanceOf( string $className)

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

register() must be called before this will work.

#### Parameters

- string $className:

#### Info

- access - public

#### Method asValue (line 150)

#### Swift_DependencyContainer asValue( mixed $value)

##### Specify the previously registered item as a literal value.

register() must be called before this will work.

#### Parameters

- mixed $value:

#### Info

- access - public

#### Method createDependenciesFor (line 116)

#### array createDependenciesFor( string $itemName)

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

#### Parameters

- string $itemName:

#### Info

- access - public

#### Method has (line 76)

#### boolean has( string $itemName)

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

#### Parameters

- string $itemName:

#### Info

- see - Swift_DependencyContainer::register()
- access - public

#### Method listItems (line 65)

#### array listItems( )

##### List the names of all items stored in the Container.

#### Info

- access - public

#### Method lookup (line 89)

#### mixed lookup( string $itemName)

##### Lookup the item with the given $itemName.

#### Parameters

- string $itemName:

#### Info

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

#### Method register (line 136)

#### 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.

#### Parameters

- string $itemName:

#### Info

- see - Swift_DependencyContainer::asNewInstanceOf(), Swift_DependencyContainer::asSharedInstanceOf(), Swift_DependencyContainer::asValue()
- access - public

#### Method withDependencies (line 211)

#### Swift_DependencyContainer withDependencies( $lookups)

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

This method takes an array of lookup names.

#### Parameters

- array $lookups:

#### Info

- see - Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
- access - public

## Inherited Variables

### Inherited Class Variable Summary

## Inherited Methods

### Inherited Method Summary

Documentation generated on Fri, 12 Nov 2010 20:45:19 +0000 by phpDocumentor 1.4.3