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 48a1e32 commit bbcdecd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ $Base->find('user')->whereIn('id', [1, 2])->update(['is_verified' => 1]);
$Base->find('user')->whereNull('location')->count();
```

Relationships:
Handle 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 in an order based on title
$Base->find('post')->belongsTo('user')->whereEqual('user.id', 123)->orderAsc('post.title')->readRecord();
# read the last post of user #123
$Base->find('post')->belongsTo('user')->whereEqual('user.id', 123)->orderDesc('post.id')->readRecord();
# read the titles of the posts that have a "php" tag
$Base->find('post')->hasAndBelongsTo('tag')->whereEqual('tag.name', 'php')->readFields('title');
```
Expand Down

0 comments on commit bbcdecd

Please sign in to comment.