From 303e84c347ee81826691e6baa2668f4b57f54565 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Thu, 13 Sep 2007 16:55:32 +0000 Subject: [PATCH] Initial entry. --- playground/data.php | 55 +++++++++++++++++++++++++++++++++++++++ playground/doctrine | 1 + playground/index.php | 2 ++ playground/models | 1 + playground/playground.php | 50 +++++++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+) create mode 100644 playground/data.php create mode 120000 playground/doctrine create mode 100644 playground/index.php create mode 120000 playground/models create mode 100644 playground/playground.php diff --git a/playground/data.php b/playground/data.php new file mode 100644 index 000000000..9cdfd8191 --- /dev/null +++ b/playground/data.php @@ -0,0 +1,55 @@ +getTable('Group')); + +$groups[0]->name = 'Drama Actors'; + +$groups[1]->name = 'Quality Actors'; + + +$groups[2]->name = 'Action Actors'; +$groups[2]['Phonenumber'][0]->phonenumber = '123 123'; +$groups->save(); + +$users = new Doctrine_Collection('User'); + + +$users[0]->name = 'zYne'; +$users[0]['Email']->address = 'zYne@example.com'; +$users[0]['Phonenumber'][0]->phonenumber = '123 123'; + +$users[1]->name = 'Arnold Schwarzenegger'; +$users[1]->Email->address = 'arnold@example.com'; +$users[1]['Phonenumber'][0]->phonenumber = '123 123'; +$users[1]['Phonenumber'][1]->phonenumber = '456 456'; +$users[1]->Phonenumber[2]->phonenumber = '789 789'; +$users[1]->Group[0] = $groups[2]; + +$users[2]->name = 'Michael Caine'; +$users[2]->Email->address = 'caine@example.com'; +$users[2]->Phonenumber[0]->phonenumber = '123 123'; + +$users[3]->name = 'Takeshi Kitano'; +$users[3]->Email->address = 'kitano@example.com'; +$users[3]->Phonenumber[0]->phonenumber = '111 222 333'; + +$users[4]->name = 'Sylvester Stallone'; +$users[4]->Email->address = 'stallone@example.com'; +$users[4]->Phonenumber[0]->phonenumber = '111 555 333'; +$users[4]['Phonenumber'][1]->phonenumber = '123 213'; +$users[4]['Phonenumber'][2]->phonenumber = '444 555'; + +$users[5]->name = 'Kurt Russell'; +$users[5]->Email->address = 'russell@example.com'; +$users[5]->Phonenumber[0]->phonenumber = '111 222 333'; + +$users[6]->name = 'Jean Reno'; +$users[6]->Email->address = 'reno@example.com'; +$users[6]->Phonenumber[0]->phonenumber = '111 222 333'; +$users[6]['Phonenumber'][1]->phonenumber = '222 123'; +$users[6]['Phonenumber'][2]->phonenumber = '123 456'; + +$users[7]->name = 'Edward Furlong'; +$users[7]->Email->address = 'furlong@example.com'; +$users[7]->Phonenumber[0]->phonenumber = '111 567 333'; + +$users->save(); \ No newline at end of file diff --git a/playground/doctrine b/playground/doctrine new file mode 120000 index 000000000..5bf80bf13 --- /dev/null +++ b/playground/doctrine @@ -0,0 +1 @@ +../lib/ \ No newline at end of file diff --git a/playground/index.php b/playground/index.php new file mode 100644 index 000000000..7bc9c2ca1 --- /dev/null +++ b/playground/index.php @@ -0,0 +1,2 @@ + $file) { + if ($file->isFile() && ! $file->isDot()) { + $e = explode('.', $file->getFileName()); + if (end($e) === 'php') { + require_once $file->getPathname(); + } + } +} + +error_reporting(E_ALL | E_STRICT); + +$dbh = new PDO('sqlite::memory:'); +$conn = Doctrine_Manager::connection($dbh); +$manager = Doctrine_Manager::getInstance(); + +$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL); + +$tables = array('entity', + 'entityReference', + 'email', + 'phonenumber', + 'groupuser', + 'album', + 'song', + 'element', + 'error', + 'description', + 'address', + 'account', + 'task', + 'resource', + 'assignment', + 'resourceType', + 'resourceReference'); + +$conn->export->exportClasses($tables); + +require_once('data.php'); \ No newline at end of file