. */ /** * Doctrine_Parser * * @author Jonathan H. Wage * @package Doctrine * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.phpdoctrine.com * @since 1.0 * @version $Revision: 1080 $ */ abstract class Doctrine_Parser { abstract public function loadData($array); abstract public function dumpData($array, $path = null); static public function getParser($type) { $class = 'Doctrine_Parser_'.ucfirst($type); return new $class; } static public function load($path, $type = 'xml') { $parser = self::getParser($type); return $parser->loadData($path); } static public function dump($array, $path = null, $type = 'xml') { $parser = self::getParser($type); return $parser->dumpData($array, $path); } static public function loadXml($path) { return self::load($path, 'xml'); } static public function dumpXml($array, $path = null) { return self::dump($array, $path, 'xml'); } static public function loadYml($path) { return self::load($path, 'yml'); } static public function dumpYml($array, $path = null) { return self::dump($array, $path, 'yml'); } }