<?php
 
 
require("rb.php");
 
 
//Init database -- default is SQLite
 
R::setup();
 
//All tables created on the fly...
 
$cat = R::dispense("cat"); //no need for model
 
$cat->name = "Tom";
 
$id=R::store( $cat ); //store cat
 
$cat = R::load("cat", $id);
 
echo $cat->name;
 
 
$mouse = R::dispense("mouse");
 
$mouse->name="Jerry"; //props added on the fly!
 
R::store($mouse);
 
R::link($cat,$mouse);
 
$mouse = R::getBean($cat,"mouse");
 
echo " and ".$mouse->name;
 
 
 |