1
0
mirror of synced 2025-02-02 05:21:44 +03:00
doctrine2/playground/index.php

27 lines
801 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');
require_once('connection.php');
require_once('models.php');
2007-09-22 01:32:48 +00:00
require_once('data.php');
$action = isset($_REQUEST['action']) ? $_REQUEST['action']:'client';
if ($action == 'server') {
2007-09-24 04:58:57 +00:00
$config = array('name' => 'Doctrine_Resource_Test_Server',
'models' => $tables);
2007-09-22 01:32:48 +00:00
2007-09-24 04:58:57 +00:00
$server = Doctrine_Resource_Server::getInstance($config);
2007-09-22 01:32:48 +00:00
$server->run($_REQUEST);
2007-09-24 04:58:57 +00:00
2007-09-22 01:32:48 +00:00
} else {
$config = array('url' => 'http://localhost/~jwage/doctrine_trunk/playground/index.php?action=server');
2007-09-24 04:58:57 +00:00
$client = Doctrine_Resource_Client::getInstance($config);
2007-09-24 18:22:52 +00:00
$query = new Doctrine_Resource_Query();
$query->from('User u, u.Email e, u.Phonenumber p');
2007-09-22 01:32:48 +00:00
2007-09-24 18:22:52 +00:00
$users = $query->execute();
print_r($users->toArray());
2007-09-22 01:32:48 +00:00
}