Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
erusev committed Feb 22, 2015
1 parent a657601 commit 48a1e32
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Read / update / count collections:
```php
# read all users
$Base->find('user')->read();
# read the email addresses of the 20 most popular users
$Base->find('user')->limit(20)->orderDesc('reputation')->readFields('email');
# read the user with the highest reputation
$Base->find('user')->limit(1)->orderDesc('reputation')->readRecord();
# update is_verified field of users #1 and #2
$Base->find('user')->whereIn('id', [1, 2])->update(['is_verified' => 1]);
# count users that don't have a location
Expand All @@ -49,10 +49,10 @@ Relationships:
```php
# read all users that have a featured post
$Base->find('user')->has('post')->whereEqual('post.is_featured', 1)->read();
# read all posts that belong to user #123 ordered by title
# read all posts that belong to user #123 in an order based on title
$Base->find('post')->belongsTo('user')->whereEqual('user.id', 123)->orderAsc('post.title')->readRecord();
# read the titles of the last 5 posts that have a "php" tag
$Base->find('post')->hasAndBelongsTo('tag')->whereEqual('tag.name', 'php')->limit(5)->orderDesc('id')->readFields('title');
# read the titles of the posts that have a "php" tag
$Base->find('post')->hasAndBelongsTo('tag')->whereEqual('tag.name', 'php')->readFields('title');
```

Execute queries:
Expand Down

0 comments on commit 48a1e32

Please sign in to comment.