예제 #1
0
  public function show($id) {
    $this->template->id = $id;

    // get the thing with id = $id
    $things = Thing::retrieve(array('id' => $id));
    if (count($things) == 1) {
      $this->template->thing = $things[0];
    }
    $this->template->id = $id;

    $this->template->display('show.html.php');
  }
예제 #2
0
 public function testBelongsToWithImmediate()
 {
     $t = new Thing();
     $t->name = "sean";
     $t->save();
     $f = new Foo();
     $f->name = "kate";
     $t->associateWith($f);
     $t1 = new Thing($t->id);
     $t1->retrieve();
     $f1 = new Foo($f->id);
     $f1->retrieve(array('with' => array('thing' => array('join_strategy' => 'Immediate'))));
     $this->assertTrue($t1->equals($f1->thing));
 }