.

ConverterChain Class Reference
[Lib]

A Converter Chain. More...

Inheritance diagram for ConverterChain:
IConverter

List of all members.

Public Member Functions

  append (IConverter $converter, $params=false)
  Append a converter to the chain.
  decode ($value, $params=false)
  encode ($value, $params=false)

Protected Attributes

  $converters = array()
  $params = array()

Detailed Description

A Converter Chain.

Author:
Gerd Riesselmann

Definition at line 8 of file chain.converter.php.


Member Function Documentation

ConverterChain::append ( IConverter converter,
params = false  
)

Append a converter to the chain.

Parameters:
IConverter  $converter The converter
mixed  $params The converters params

Definition at line 38 of file chain.converter.php.

00038                                                                        {
00039                 $this->converters[] = $converter;
00040                 $this->params[] = $params;
00041         }
ConverterChain::decode ( value,
params = false  
)

Implements IConverter.

Definition at line 22 of file chain.converter.php.

00022                                                         {
00023                 reset($this->params);
00024                 foreach($this->converters as $c) {
00025                         $p = current($this->params);
00026                         $value = $c->decode($value, $p);
00027                         next($this->params);
00028                 }
00029                 return $value;
00030         }       
ConverterChain::encode ( value,
params = false  
)

Implements IConverter.

Definition at line 12 of file chain.converter.php.

00012                                                         {
00013                 reset($this->params);
00014                 foreach($this->converters as $c) {
00015                         $p = current($this->params);
00016                         $value = $c->encode($value, $p);
00017                         next($this->params);
00018                 }
00019                 return $value;
00020         }

Member Data Documentation

ConverterChain::$converters = array() [protected]

Definition at line 9 of file chain.converter.php.

ConverterChain::$params = array() [protected]

Definition at line 10 of file chain.converter.php.


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