test case for updating a new object when calling save()
authorChuck Hagenbuch <chuck@horde.org>
Thu, 3 Sep 2009 03:27:36 +0000 (23:27 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 3 Sep 2009 03:27:36 +0000 (23:27 -0400)
framework/Rdo/examples/Horde/Rdo/User.php

index 2f6627e..a259885 100644 (file)
@@ -46,7 +46,10 @@ if ($userTwo) {
     echo "Found Alice: id $userTwo->id\n";
 } else {
     echo "No Alice found, creating:\n";
-    $userOne = $um->create(array('name' => 'Alice', 'phone' => '212-555-6565'));
+    // $userOne = $um->create(array('name' => 'Alice', 'phone' => '212-555-6565'));
+    $userOne = new User(array('name' => 'Alice', 'phone' => '212-555-6565'));
+    $userOne->setMapper($um);
+    $userOne->save();
     $userOneId = $userOne->id;
     echo "Created new user with id: $userOneId\n";
 }