unsolved.php 919 Bytes
Newer Older
zYne's avatar
zYne committed
1 2 3 4 5 6 7 8 9 10
<?php
require_once dirname(__FILE__) . '/../lib/Doctrine.php';


error_reporting(E_ALL);

spl_autoload_register(array('Doctrine', 'autoload'));
require_once 'classes.php';
require_once dirname(__FILE__) . '/../models/location.php';

zYne's avatar
zYne committed
11 12
print "<pre>";

zYne's avatar
zYne committed
13 14 15
$manager = Doctrine_Manager::getInstance();
$dbh = Doctrine_Db::getConnection('sqlite::memory:');
$conn = $manager->openConnection($dbh);
zYne's avatar
zYne committed
16
/**
zYne's avatar
zYne committed
17 18 19 20
$user = new User();
$user->name = 'zYne';
$user->Phonenumber[0]->phonenumber = '123 123';
if ($user === $user->Phonenumber[0]->entity_id) {
zYne's avatar
zYne committed
21
    print 'case 1 works\n';
zYne's avatar
zYne committed
22 23 24 25 26 27
}
$city = new Record_City();
$city->name = 'City 1';
$city->District->name = 'District 1';

if ($city->District === $city->district_id) {
zYne's avatar
zYne committed
28
    print 'case 2 works\n';
zYne's avatar
zYne committed
29
}
zYne's avatar
zYne committed
30
*/
zYne's avatar
zYne committed
31 32 33

$c = new Record_Country();
$c->name = 'Some country';
zYne's avatar
zYne committed
34 35 36
$city = $c->City[0];
$city->name = 'City 1';
$city->District->name = 'District 1';
zYne's avatar
zYne committed
37

zYne's avatar
zYne committed
38
$c->save();