<?php
require_once '../lumine/LumineConfiguration.php';
$conf = new LumineConfiguration("lumine-conf.xml");
/* show up whats happen */
LumineLog::setLevel(4);
LumineLog::setOutput('browser');
Util::import("com.domain.classes.Person");
Util::import("com.domain.classes.Car");
$person = new Person;
$car1 = new Car;
$car2 = new Car;
$person->name = 'John';
$person->eyecolor = 'Blue';
$person->age = 24;
$car1->color = 'Red';
$car1->model = 'Verona';
$car2->color = 'Black';
$car2->model = 'Vectra';
/** inserts the two new cars in the new person. Lumine automatically saves everything */
$person->cars[] = &$car1;
$person->cars[] = &$car2;
$person->save();
?>
|