Skip to content

Commit

Permalink
updating tutorials
Browse files Browse the repository at this point in the history
git-svn-id: http://mongodb-morph.googlecode.com/svn/trunk@122 406649b4-5d4b-11de-8abc-d1c337b90d21
  • Loading branch information
XirisR authored and XirisR committed Feb 1, 2010
1 parent 5e63ac0 commit bccf04a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
3 changes: 1 addition & 2 deletions mongodb-morph/src/tutorials/Morph/examples/BasicQuerying.php
Expand Up @@ -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);
Expand Up @@ -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;
Expand Up @@ -12,6 +12,4 @@
$user->dateOfBirth = strtotime('1978-09-12');

//Store that baby!
$storage->save($user);

?>
$user->save($user);
Expand Up @@ -10,5 +10,4 @@
->skip(10)
->property('numberOfPosts')
->greaterThan(15);
$users = $user->findByQuery($query);
?>
$users = $user->findByQuery($query);
3 changes: 1 addition & 2 deletions mongodb-morph/src/tutorials/Morph/examples/MinimalObject.php
Expand Up @@ -21,5 +21,4 @@ public function __construct($id = null) {

}

}
?>
}
7 changes: 4 additions & 3 deletions mongodb-morph/src/tutorials/Morph/examples/UberQuery.php
Expand Up @@ -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'));
/**
Expand All @@ -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.