Skip to content

Commit

Permalink
Add in a code sample to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
treffynnon committed Jan 25, 2013
1 parent 132e06c commit 219e92a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,28 @@ You will need to install [Sphinx](http://sphinx-doc.org/) and then in the docs f

The documentation will now be in docs/_build/html/index.html

Let's See Some Code
-------------------

class User extends Model {
public function tweets() {
return $this->has_many('Tweet');
}
}

class Tweet extends Model {}

$user = Model::factory('User')
->where_equal('username', 'j4mie')
->find_one();
$user->first_name = 'Jamie';
$user->save();

$tweets = $user->tweets()->find_many();
foreach ($tweets as $tweet) {
echo $tweet->text;
}

Changelog
---------

Expand Down

0 comments on commit 219e92a

Please sign in to comment.