Class Xyster_Container_Parameter_Basic

Description

Implements interfaces:

Should be used to pass in a particular component as argument to a different component's constructor

This is particularly useful in cases where several components of the same type have been registered, but with a different key. Passing a Parameter as a parameter when registering a component will give the Container a hint about what other component to use in the constructor. This Parameter will never resolve against a collecting type, that is not directly registered in the Container itself.

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

Located in /Container/Parameter/Basic.php (line 35)


	
			
Variable Summary
static mixed $_default
Method Summary
Xyster_Container_Parameter_Basic __construct ([mixed $key = null])
void accept (Xyster_Container_Visitor $visitor)
boolean isResolvable (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)
mixed resolveInstance (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)
void verify (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)
boolean _areCompatible ( $expectedType, Xyster_Container_Adapter $found)
Xyster_Container_Adapter _getTargetAdapter (Xyster_Container_Interface $container,  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, [Xyster_Container_Adapter $excludeAdapter = null],  $useNames, ReflectionParameter $expectedParameter)
Xyster_Container_Adapter _resolveAdapter (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding,  $useNames, ReflectionParameter $expectedParameter)
Variables
static mixed $_default (line 39)
  • access: protected
Methods
static method standard (line 46)

Gets a simple parameter

  • access: public
Constructor __construct (line 62)

Creates a new basic parameter

If the $key parameter is null, this object will match any parameter of the appropriate type.

  • access: public
Xyster_Container_Parameter_Basic __construct ([mixed $key = null])
  • mixed $key: The key of the desired component
accept (line 72)

Visit the current parameter

  • access: public
void accept (Xyster_Container_Visitor $visitor)

Implementation of:
Xyster_Container_Parameter::accept()
Accepts a visitor for this Parameter
isResolvable (line 87)

Check if the Parameter can statisfy the expected type using the container.

  • return:
    1. true
    if the component parameter can be resolved.
  • access: public
boolean isResolvable (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)

Implementation of:
Xyster_Container_Parameter::isResolvable()
Check if the Parameter can statisfy the expected type using the container.
resolveInstance (line 103)

Retrieve the object from the Parameter that statisfies the expected type.

  • return: the instance or
    1. null
    if no suitable instance can be found.
  • throws: Xyster_Container_Exception if a referenced component could not be instantiated.
  • access: public
mixed resolveInstance (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)

Implementation of:
Xyster_Container_Parameter::resolveInstance()
Retrieve the object from the Parameter that statisfies the expected type.
verify (line 129)

Verify that the Parameter can statisfied the expected type using the container

  • throws: Xyster_Container_Parameter_Exception if parameter and its dependencies cannot be resolved
  • access: public
void verify (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, boolean $useNames)

Implementation of:
Xyster_Container_Parameter::verify()
Verify that the Parameter can statisfied the expected type using the container
_areCompatible (line 146)

Tests to see if a type and an adapter are compatible

  • access: protected
boolean _areCompatible ( $expectedType, Xyster_Container_Adapter $found)
_getTargetAdapter (line 160)

Gets the adapter for the parameter supplied

  • access: protected
Xyster_Container_Adapter _getTargetAdapter (Xyster_Container_Interface $container,  $expectedType, Xyster_Container_NameBinding $expectedNameBinding, [Xyster_Container_Adapter $excludeAdapter = null],  $useNames, ReflectionParameter $expectedParameter)
_resolveAdapter (line 213)

Tries to resolve the adapter used for the type

  • access: protected
Xyster_Container_Adapter _resolveAdapter (Xyster_Container_Interface $container, [Xyster_Container_Adapter $adapter = null],  $expectedType, Xyster_Container_NameBinding $expectedNameBinding,  $useNames, ReflectionParameter $expectedParameter)

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