Interface Xyster_Container_Mutable

Description

Core interface for registration of components within a container

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Container/Mutable.php (line 28)

Xyster_Container_Interface
   |
   --Xyster_Container_Mutable
Method Summary
Xyster_Container_Mutable addAdapter (Xyster_Container_Adapter $componentAdapter, [ $properties = null])
Xyster_Container_Mutable addComponent ( $implementation, [mixed $key = null], [ $parameters = null], mixed $implementationOrInstance)
Xyster_Container_Mutable addComponentInstance (mixed $instance, [mixed $key = null])
Xyster_Container_Mutable addConfig (string $name, mixed $val)
Xyster_Container_Adapter removeComponent (mixed $componentKey)
Xyster_Container_Mutable with ( $properties)
Methods
addAdapter (line 41)

Register a component via an Adapter

Use this if you need fine grained control over what Adapter to use for a specific component.

  • return: provides a fluent interface
  • throws: Xyster_Container_Exception if registration fails
Xyster_Container_Mutable addAdapter (Xyster_Container_Adapter $componentAdapter, [ $properties = null])
addComponent (line 72)

Register a component

This method creates specific instructions with which components and/or constants to provide as constructor arguments.

If the key is null, the implementation class will be used as a key.

These "directives" are provided through an array of Parameter objects. Parameter[0] correspondes to the first constructor argument, Parameter[N] corresponds to the N+1th constructor argument.

Partial Autowiring: If you have two constructor args to match and you only wish to specify one of the constructors and let the Container wire the other one, you can use as parameters:

  1. new ComponentParameter()new ComponentParameter("someService")
The constructor for the component parameter indicates auto-wiring should take place for that parameter.

Force No-Arg constructor usage: If you wish to force a component to be constructed with the no-arg constructor, use a zero length Parameter array.

  • return: provides a fluent interface
  • throws: Xyster_Container_Exception if registration of the component fails
Xyster_Container_Mutable addComponent ( $implementation, [mixed $key = null], [ $parameters = null], mixed $implementationOrInstance)
  • mixed $implementationOrInstance: the component's implementation class
  • mixed $key: a key unique within the container that identifies the component
  • mixed $parameters: the parameters that gives hints about what arguments to pass
  • $implementation
addComponentInstance (line 84)

Register a component instance

If the key is null, the implementation class will be used as a key.

  • return: provides a fluent interface
  • throws: Xyster_Container_Exception if registration of the component fails
Xyster_Container_Mutable addComponentInstance (mixed $instance, [mixed $key = null])
  • mixed $instance: an instance of the component
  • mixed $key: a key unique within the container that identifies the component
addConfig (line 94)

Register a config item

  • return: provides a fluent interface
  • throws: Xyster_Container_Exception if registration fails
Xyster_Container_Mutable addConfig (string $name, mixed $val)
  • string $name: the name of the config item
  • mixed $val: the value of the config item
change (line 102)

You can change the characteristic of registration of all subsequent components in this container

  • return: provides a fluent interface
Xyster_Container_Mutable change ( $properties)
  • Xyster_Collection_Map_Interface $properties
removeComponent (line 110)

Unregister a component by key

  • return: the adapter that was associated with this component
Xyster_Container_Adapter removeComponent (mixed $componentKey)
  • mixed $componentKey: key of the component to unregister.
removeComponentByInstance (line 118)

Unregister a component by instance

  • return: the adapter removed
Xyster_Container_Adapter removeComponentByInstance (mixed $componentInstance)
  • mixed $componentInstance: the component instance to unregister.
with (line 126)

You can set for the following operation only the characteristic of registration of a component on the fly

  • return: the same instance with temporary properties
Xyster_Container_Mutable with ( $properties)
  • Xyster_Collection_Map_Interface $properties

Inherited Methods

Inherited From Xyster_Container_Interface

Xyster_Container_Interface::accept()
Xyster_Container_Interface::getComponent()
Xyster_Container_Interface::getComponentAdapter()
Xyster_Container_Interface::getComponentAdapterByType()
Xyster_Container_Interface::getComponentAdapters()
Xyster_Container_Interface::getComponents()

Documentation generated on Mon, 19 May 2008 17:08:25 -0400 by phpDocumentor 1.4.2