Example #1
0
 if (!class_exists("Trick")) {
     class Trick extends RedBean_Decorator
     {
         public function __construct($id = 0)
         {
             parent::__construct("Customer", $id);
         }
         public function setHallo()
         {
             return "hallodaar";
         }
     }
 }
 $trick = new Trick();
 $trick->importFromPost(array("hallo", "there"));
 $message = array_shift($trick->problems());
 if ($message === "hallodaar") {
     SmartTest::instance()->progress();
 } else {
     die("<b style='color:red'>Error CANNOT:" . SmartTest::instance()->canwe);
     exit;
 }
 SmartTest::instance()->progress();
 SmartTest::instance()->canwe = "avoid race-conditions by locking?";
 RedBean_OODB::gen("Cheese,Wine");
 $cheese = new Cheese();
 $cheese->setName('Brie');
 $cheese->save();
 $cheese = new Cheese(1);
 //try to mess with the locking system...
 $oldkey = RedBean_OODB::$pkey;