Added aliases.
This commit is contained in:
parent
39c3f2e0f8
commit
13d781cb68
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user