Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift
  • Swift_ConfigurableSpool
  • Swift_DependencyContainer
  • Swift_FileSpool
  • Swift_Mailer
  • Swift_MemorySpool
  • Swift_NullTransport
  • Swift_Preferences
  • Swift_SpoolTransport
  • Swift_StreamFilters_ByteArrayReplacementFilter
  • Swift_StreamFilters_StringReplacementFilter
  • Swift_StreamFilters_StringReplacementFilterFactory
  • Swift_Transport_NullTransport
  • Swift_Transport_SpoolTransport
  • Swift_Validate

Interfaces

  • Swift_DependencyException
  • Swift_Filterable
  • Swift_IoException
  • Swift_ReplacementFilterFactory
  • Swift_RfcComplianceException
  • Swift_Spool
  • Swift_StreamFilter
  • Swift_SwiftException
  • Overview
  • Package
  • Class
  • Todo
  • Download

Class Swift_DependencyContainer

Dependency Injection container.

Package: Swift
Author: Chris Corbyn
Located at classes/swiftmailer/lib/classes/Swift/DependencyContainer.php
Methods summary
public
# __construct( )

Constructor should not be used. Use Swift_DependencyContainer::getInstance() instead.

Constructor should not be used. Use Swift_DependencyContainer::getInstance() instead.

public static Swift_DependencyContainer
# getInstance( )

Returns a singleton of the DependencyContainer.

Returns a singleton of the DependencyContainer.

Returns

Swift_DependencyContainer
public array
# listItems( )

List the names of all items stored in the Container.

List the names of all items stored in the Container.

Returns

array
public boolean
# has( string $itemName )

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

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

Parameters

$itemName

Returns

boolean

See

Swift_DependencyContainer::register()
public mixed
# lookup( string $itemName )

Lookup the item with the given $itemName.

Lookup the item with the given $itemName.

Parameters

$itemName

Returns

mixed

Throws

Swift_DependencyException
If the dependency is not found

See

Swift_DependencyContainer::register()
public array
# createDependenciesFor( string $itemName )

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

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

Parameters

$itemName

Returns

array
public 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.

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

$itemName

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::asNewInstanceOf(), Swift_DependencyContainer::asSharedInstanceOf(), Swift_DependencyContainer::asValue()
public Swift_DependencyContainer
# asValue( mixed $value )

Specify the previously registered item as a literal value. Swift_DependencyContainer::register() must be called before this will work.

Specify the previously registered item as a literal value. Swift_DependencyContainer::register() must be called before this will work.

Parameters

$value

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# asAliasOf( string $lookup )

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

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

Parameters

$lookup

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# asNewInstanceOf( string $className )

Specify the previously registered item as a new instance of $className. Swift_DependencyContainer::register() must be called before this will work. Any arguments can be set with Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue() or Swift_DependencyContainer::addConstructorLookup().

Specify the previously registered item as a new instance of $className. Swift_DependencyContainer::register() must be called before this will work. Any arguments can be set with Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue() or Swift_DependencyContainer::addConstructorLookup().

Parameters

$className

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# asSharedInstanceOf( string $className )

Specify the previously registered item as a shared instance of $className. Swift_DependencyContainer::register() must be called before this will work.

Specify the previously registered item as a shared instance of $className. Swift_DependencyContainer::register() must be called before this will work.

Parameters

$className

Returns

Swift_DependencyContainer
public Swift_DependencyContainer
# withDependencies( array $lookups )

Specify a list of injected dependencies for the previously registered item. This method takes an array of lookup names.

Specify a list of injected dependencies for the previously registered item. This method takes an array of lookup names.

Parameters

$lookups

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::addConstructorValue(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# addConstructorValue( mixed $value )

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

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

Parameters

$value

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorLookup()
public Swift_DependencyContainer
# addConstructorLookup( string $lookup )

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

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

Parameters

$lookup

Returns

Swift_DependencyContainer

See

Swift_DependencyContainer::withDependencies(), Swift_DependencyContainer::addConstructorValue()
private
# _getValue( $itemName )

Get the literal value with $itemName

Get the literal value with $itemName

private
# _createAlias( $itemName )

Resolve an alias to another item

Resolve an alias to another item

private
# _createNewInstance( $itemName )

Create a fresh instance of $itemName

Create a fresh instance of $itemName

private
# _createSharedInstance( $itemName )

Create and register a shared instance of $itemName

Create and register a shared instance of $itemName

private &
# _getEndPoint( )

Get the current endpoint in the store

Get the current endpoint in the store

private
# _resolveArgs( array $args )

Get an argument list with dependencies resolved

Get an argument list with dependencies resolved

private
# _lookupRecursive( $item )

Resolve a single dependency with an collections

Resolve a single dependency with an collections

Constants summary
integer TYPE_VALUE

Constant for literal value types

Constant for literal value types

# 0x0001
integer TYPE_INSTANCE

Constant for new instance types

Constant for new instance types

# 0x0010
integer TYPE_SHARED

Constant for shared instance types

Constant for shared instance types

# 0x0100
integer TYPE_ALIAS

Constant for aliases

Constant for aliases

# 0x1000
Properties summary
private static $_instance

Singleton instance

Singleton instance

# null
private array $_store

The data container

The data container

# array()
private $_endPoint

The current endpoint in the data container

The current endpoint in the data container

#
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen