1
0
mirror of synced 2025-01-17 22:11:41 +03:00

Added aliases.

This commit is contained in:
Jonathan.Wage 2007-09-13 19:25:52 +00:00
parent 39c3f2e0f8
commit 13d781cb68
3 changed files with 22 additions and 19 deletions

View File

@ -41,24 +41,7 @@ class Doctrine_Export_Schema_Xml extends Doctrine_Export_Schema
*/
public function build($array)
{
$xml = new SimpleXMLElement();
foreach ($array as $tableName => $fields) {
$table = $xml->addChild('table');
$name = $table->addChild('name', $tableName);
$declaration = $table->addChild('declaration');
foreach ($fields as $fieldName => $properties) {
$field = $declaration->addChild('field');
$field->addChild('name', $fieldName);
foreach ($properties as $key => $value) {
$field->addChild($key, $value);
}
}
}
return $xml->asXml();
return Doctrime_Parser::dump($array, null, 'xml');
}
/**

View File

@ -41,7 +41,7 @@ class Doctrine_Export_Schema_Yml extends Doctrine_Export_Schema
*/
public function build($array)
{
return var_dump($array);
return Doctrime_Parser::dump($array, null, 'yml');
}
/**

View File

@ -54,4 +54,24 @@ abstract class Doctrine_Parser
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');
}
}