Doctrine 1.2.4
Doctrine_Record_Listener_Chain Class Reference

Inherits Doctrine_Access, and Doctrine_Record_Listener_Interface.

Public Member Functions

 __get ($name)
 
 __isset ($name)
 
 __set ($name, $value)
 
 __unset ($name)
 
 add ($listener, $name=null)
 
 add ($value)
 
 bind ($name, $resource)
 
 contains ($offset)
 
 get ($key)
 
 getLocator ()
 
 getOption ($name)
 
 getOptions ()
 
 locate ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 remove ($offset)
 
 set ($key, $listener)
 
 setArray (array $array)
 
 setLocator (Doctrine_Locator $locator)
 
 setOption ($name, $value=null)
 

Static Public Member Functions

static getNullObject ()
 
static initNullObject (Doctrine_Null $null)
 

Detailed Description

Definition at line 35 of file Chain.php.

Member Function Documentation

Doctrine_Access::__get (   $name)
inherited

Get key from data

See Also
get, offsetGet
Parameters
mixed$name
Returns
mixed

Definition at line 70 of file Access.php.

{
return $this->get($name);
}
Doctrine_Access::__isset (   $name)
inherited

Check if key exists in data

Parameters
string$name
Returns
boolean whether or not this object contains $name

Definition at line 81 of file Access.php.

{
return $this->contains($name);
}
Doctrine_Access::__set (   $name,
  $value 
)
inherited

Set key and value to data

See Also
set, offsetSet
Parameters
$name
$value
Returns
void

Definition at line 58 of file Access.php.

{
$this->set($name, $value);
}
Doctrine_Access::__unset (   $name)
inherited

Remove key from data

Parameters
string$name
Returns
void

Definition at line 92 of file Access.php.

{
return $this->remove($name);
}
Doctrine_Record_Listener_Chain::add (   $listener,
  $name = null 
)

add adds a listener to the chain of listeners

Parameters
object$listener
string$name
Returns
void

Definition at line 97 of file Chain.php.

{
if ( ! ($listener instanceof Doctrine_Record_Listener_Interface) &&
! ($listener instanceof Doctrine_Overloadable)) {
throw new Doctrine_EventListener_Exception("Couldn't add eventlistener. Record listeners should implement either Doctrine_Record_Listener_Interface or Doctrine_Overloadable");
}
if ($name === null) {
$this->_listeners[] = $listener;
} else {
$this->_listeners[$name] = $listener;
}
}
Doctrine_Access::add (   $value)
inherited

Add the value

Parameters
mixed$valueThe value to add
Returns
void

Definition at line 199 of file Access.php.

{
throw new Doctrine_Exception('Add is not supported for ' . get_class($this));
}
Doctrine_Locator_Injectable::bind (   $name,
  $resource 
)
inherited

bind binds a resource to a name

Parameters
string$namethe name of the resource to bind
mixed$valuethe value of the resource
Returns
Doctrine_Locator this object

Definition at line 120 of file Injectable.php.

{
$this->_resources[$name] = $resource;
return $this;
}
Doctrine_Access::contains (   $offset)
inherited

Check if the specified offset exists

Parameters
mixed$offsetThe offset to check
Returns
boolean True if exists otherwise false

Definition at line 188 of file Access.php.

{
throw new Doctrine_Exception('Contains is not supported for ' . get_class($this));
}
Doctrine_Record_Listener_Chain::get (   $key)

returns a Doctrine_Record_Listener on success and null on failure

Parameters
mixed$key
Returns
mixed

Definition at line 118 of file Chain.php.

{
if ( ! isset($this->_listeners[$key])) {
return null;
}
return $this->_listeners[$key];
}
Doctrine_Locator_Injectable::getLocator ( )
inherited

getLocator returns the locator associated with this object

if there are no locator locally associated then this method tries to fetch the current global locator

Returns
Doctrine_Locator

Definition at line 75 of file Injectable.php.

{
if ( ! isset($this->_locator)) {
$this->_locator = Doctrine_Locator::instance();
}
return $this->_locator;
}
static Doctrine_Locator_Injectable::getNullObject ( )
staticinherited

getNullObject returns the null object associated with this object

Returns
Doctrine_Null

Definition at line 145 of file Injectable.php.

{
return self::$_null;
}
Doctrine_Record_Listener_Chain::getOption (   $name)

getOption returns the value of given option

Parameters
string$namethe name of the option
Returns
mixed the value of given option

Definition at line 70 of file Chain.php.

{
if (isset($this->_options[$name])) {
return $this->_options[$name];
}
return null;
}
Doctrine_Record_Listener_Chain::getOptions ( )

Get array of configured options

Returns
array $options

Definition at line 84 of file Chain.php.

{
return $this->_options;
}
static Doctrine_Locator_Injectable::initNullObject ( Doctrine_Null  $null)
staticinherited

initNullObject initializes the null object

Parameters
Doctrine_Null$null
Returns
void

Definition at line 134 of file Injectable.php.

{
self::$_null = $null;
}
Doctrine_Locator_Injectable::locate (   $name)
inherited

locate locates a resource by given name and returns it

if the resource cannot be found locally this method tries to use the global locator for finding the resource

See Also
Doctrine_Locator::locate()
Exceptions
Doctrine_Locator_Exceptionif the resource could not be found
Parameters
string$namethe name of the resource
Returns
mixed the located resource

Definition at line 96 of file Injectable.php.

{
if (isset($this->_resources[$name])) {
if (is_object($this->_resources[$name])) {
return $this->_resources[$name];
} else {
// get the name of the concrete implementation
$concreteImpl = $this->_resources[$name];
return $this->getLocator()->locate($concreteImpl);
}
} else {
return $this->getLocator()->locate($name);
}
}
Doctrine_Access::offsetExists (   $offset)
inherited

Check if an offset axists

Parameters
mixed$offset
Returns
boolean Whether or not this object contains $offset

Definition at line 103 of file Access.php.

{
return $this->contains($offset);
}
Doctrine_Access::offsetGet (   $offset)
inherited

An alias of get()

See Also
get, __get
Parameters
mixed$offset
Returns
mixed

Definition at line 115 of file Access.php.

{
return $this->get($offset);
}
Doctrine_Access::offsetSet (   $offset,
  $value 
)
inherited

Sets $offset to $value

See Also
set, __set
Parameters
mixed$offset
mixed$value
Returns
void

Definition at line 128 of file Access.php.

{
if ( ! isset($offset)) {
$this->add($value);
} else {
$this->set($offset, $value);
}
}
Doctrine_Access::offsetUnset (   $offset)
inherited

Unset a given offset

See Also
set, offsetSet, __set
Parameters
mixed$offset

Definition at line 143 of file Access.php.

{
return $this->remove($offset);
}
Doctrine_Access::remove (   $offset)
inherited

Remove the element with the specified offset

Parameters
mixed$offsetThe offset to remove
Returns
boolean True if removed otherwise false

Definition at line 154 of file Access.php.

{
throw new Doctrine_Exception('Remove is not supported for ' . get_class($this));
}
Doctrine_Record_Listener_Chain::set (   $key,
  $listener 
)

set

Parameters
mixed$key
Doctrine_Record_Listener$listenerlistener to be added
Returns
Doctrine_Record_Listener_Chain this object

Definition at line 133 of file Chain.php.

{
$this->_listeners[$key] = $listener;
}
Doctrine_Access::setArray ( array  $array)
inherited

Set an entire aray to the data

Parameters
array$arrayAn array of key => value pairs
Returns
Doctrine_Access

Definition at line 41 of file Access.php.

{
foreach ($array as $k => $v) {
$this->set($k, $v);
}
return $this;
}
Doctrine_Locator_Injectable::setLocator ( Doctrine_Locator  $locator)
inherited

setLocator this method can be used for setting the locator object locally

Parameters
Doctrine_Locatorthe locator object
Returns
Doctrine_Locator_Injectable this instance

Definition at line 60 of file Injectable.php.

{
$this->_locator = $locator;
return $this;
}
Doctrine_Record_Listener_Chain::setOption (   $name,
  $value = null 
)

setOption sets an option in order to allow flexible listener chaining

Parameters
mixed$namethe name of the option to set
mixed$valuethe value of the option

Definition at line 54 of file Chain.php.

{
if (is_array($name)) {
$this->_options = Doctrine_Lib::arrayDeepMerge($this->_options, $name);
} else {
$this->_options[$name] = $value;
}
}

The documentation for this class was generated from the following file: