Source for file Abstract.class.php
Documentation is available at Abstract.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* 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.
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* @desc Abstract Converter Class
gumbo_load ("Interface_Converter");
* Converts one variable type to another
* @param string $to action to perform (required)
* @throws Gumbo_Exception
public function convert ($data, $to=
null) {
return $this->$to ($data);
$e->setFunction (__METHOD__
);