1
0
mirror of synced 2025-01-18 22:41:43 +03:00
doctrine2/playground/index.php

29 lines
914 B
PHP
Raw Normal View History

2007-09-13 16:55:32 +00:00
<?php
2007-09-19 16:26:28 +00:00
require_once('playground.php');
2007-09-25 14:09:05 +00:00
if (isset($_REQUEST['server'])) {
2007-09-25 14:09:05 +00:00
require_once('connection.php');
require_once('models.php');
require_once('data.php');
$name = 'Doctrine_Resource_Playground';
$config = array('models' => $tables);
$server = Doctrine_Resource_Server::getInstance($name, $config);
$server->run($_REQUEST);
} else {
$url = 'http://localhost/~jwage/doctrine_trunk/playground/index.php?server';
$config = array('format' => 'xml');
2007-09-25 14:09:05 +00:00
// Instantiate a new client
$client = Doctrine_Resource_Client::getInstance($url, $config);
$query = new Doctrine_Resource_Query();
$users = $query->from('User u, u.Phonenumber p, u.Email e, u.Address a')->execute();
$json = Doctrine_Parser::load(Doctrine_Parser::dump($users->getFirst()->toArray(true, true), 'json'), 'json');
print_r($json);
2007-09-25 14:09:05 +00:00
}