Gumbo_Converter_Abstract



Abstract Converter Class

The Abstract Converter defines a particular set of rules to follow. These will indicate how to extend the class and utilize a dynamic 'convert' method. The idea is centered around 'to' methods. A 'to' method provides implementation to change a data type to something else. There can be multiple 'to' methods inside a Converter class. The method name (excluding 'to') will be passed into the 'to' argument. The method will be executed, returning the results.

For example, the Converter_Array class defines a single 'to' method (toComposite). This will take an array and convert it into a Composite object.

 $convert = new Gumbo_Converter_Array ();
 $composite = $convert->convert ($data_array, "composite");

The idea is to define a class of a certain type (Array), and provide 'to' methods to change the type into different formats.

Author(s): Michael Luster <mluster79@yahoo.com>
License:New BSD License
Copyright:Copyright (c) 2007, iBayou, Michael Luster
Link:http://sourceforge.net/projects/phpgumbo
Version:0.0.1

Implements interfaces:

Child classes:

Class Methods

public mixed convert ( mixed $data, [string $to] ) [line 61]

Converts one variable type to another

Parameter(s):

  • (mixed) $data
  • (string) $to :: action to perform (required)
  • throws:  Gumbo_Exception
Implementation of:
Gumbo_Interface_Converter::convert()

[ Top ]