Permalink
Browse files

updating tutorials

git-svn-id: http://mongodb-morph.googlecode.com/svn/trunk@122 406649b4-5d4b-11de-8abc-d1c337b90d21
  • Loading branch information...
1 parent 5e63ac0 commit bccf04a6521ed4a22e51afaf9189d4050193b635 XirisR committed Feb 1, 2010
@@ -7,5 +7,4 @@
$user = new User();
$query = new Morph_Query();
$query->property('userName')->equals('j.d.moss');
-$users = $user->findByQuery($query);
-?>
+$users = $user->findByQuery($query);
@@ -6,8 +6,7 @@
//Fetches and instance of User by its id
$user = new User();
-$user = $storage->loadById(1234);
+$user = $user->loadById(1234);
//do something with it's properties
-echo $user->firstName;
-?>
+echo $user->firstName;
@@ -12,6 +12,4 @@
$user->dateOfBirth = strtotime('1978-09-12');
//Store that baby!
-$storage->save($user);
-
-?>
+$user->save($user);
@@ -10,5 +10,4 @@
->skip(10)
->property('numberOfPosts')
->greaterThan(15);
-$users = $user->findByQuery($query);
-?>
+$users = $user->findByQuery($query);
@@ -21,5 +21,4 @@ public function __construct($id = null) {
}
-}
-?>
+}
@@ -9,6 +9,7 @@
->lessThan(new MondoDate(time())) //today
->property('cost')
->greaterThanOrEqualTo(12.99)
+ ->sort(Morph_Enum::DIRECTION_ASC)
->property('publisher')
->in(array('publisherA', 'publisherB', 'publisherC'));
/**
@@ -17,8 +18,8 @@
* `createdDate` > DATE_SUB(now(), INTERVAL 1 WEEK)
* AND `createdDate` < now()
* AND `cost` >= 12.99
- * AND `publisher` in ('publisherA', 'publisherB', 'publisherC');
+ * AND `publisher` in ('publisherA', 'publisherB', 'publisherC')
+ * ORDER BY `cost`;
*/
$book = new A_Book();
-$books = $book->findByQuery($query);
-?>
+$books = $book->findByQuery($query);

0 comments on commit bccf04a

Please sign in to comment.