1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Changed default to yml.

This commit is contained in:
Jonathan.Wage 2007-09-25 22:32:32 +00:00
parent 8c8d8187a5
commit 77daa29c2c
5 changed files with 11 additions and 4 deletions

View File

@ -82,7 +82,7 @@ class Doctrine_Resource_Client extends Doctrine_Resource
$import = new Doctrine_Import_Schema(); $import = new Doctrine_Import_Schema();
$schema = $import->buildSchema($path, $this->getConfig()->get('format')); $schema = $import->buildSchema($path, $this->getConfig()->get('format'));
if (file_exists($classesPath)) { if (!file_exists($classesPath)) {
$build = "<?php\n"; $build = "<?php\n";
foreach ($schema['schema'] as $className => $details) { foreach ($schema['schema'] as $className => $details) {
$build .= "class " . $className . " extends Doctrine_Resource_Record { protected \$_model = '".$className."'; public function __construct(\$loadRelations = true) { parent::__construct(\$this->_model, \$loadRelations); } }\n"; $build .= "class " . $className . " extends Doctrine_Resource_Record { protected \$_model = '".$className."'; public function __construct(\$loadRelations = true) { parent::__construct(\$this->_model, \$loadRelations); } }\n";

View File

@ -48,7 +48,6 @@ class Doctrine_Resource_Table
if (isset($schema['relations'][$model]) && $schema['relations'][$model]) { if (isset($schema['relations'][$model]) && $schema['relations'][$model]) {
$this->_schema['relations'] = $schema['relations'][$model]; $this->_schema['relations'] = $schema['relations'][$model];
$this->_schema['schema']['relations'] = $this->_schema['relations'];
} }
} }

View File

@ -16,15 +16,17 @@ if ($action == 'server') {
} else { } else {
$url = 'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server'; $url = 'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server';
$config = array(); $config = array('format' => 'yml');
// Instantiate a new client // Instantiate a new client
$client = Doctrine_Resource_Client::getInstance($url, $config); $client = Doctrine_Resource_Client::getInstance($url, $config);
/*
$query = new Doctrine_Resource_Query(); $query = new Doctrine_Resource_Query();
$users = $query->from('User u, u.Group g')->execute(); $users = $query->from('User u, u.Group g')->execute();
print_r($users->toArray(true)); print_r($users->toArray(true));
*/
/* /*
$group = new Group(); $group = new Group();

File diff suppressed because one or more lines are too long

View File

@ -603,6 +603,12 @@ User:
local: user_id local: user_id
foreign: address_id foreign: address_id
type: many type: many
Addresses:
refClass: EntityAddress
class: Address
local: user_id
foreign: address_id
type: many
Album: Album:
local: id local: id
foreign: user_id foreign: user_id