Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Mar 20, 2016
1 parent 01e7bc0 commit 8352e96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ $user = $repository->find(4);

### Using `EntityRepository`

Extend `Rougin\Credo\Loader` to your `MY_Loader`.
Extend `Rougin\Credo\Loader` to `MY_Loader`.

**application/core/Welcome.php**
**application/core/MY_Loader.php**

``` php
class MY_Loader extends Rougin\Credo\Loader {}
```

You can now load a repository by using `$this->load->repository($repositoryName)`.

Kindly also use the suffix `_repository` for creating repositories. (e.g. `User_repository`)

**application/repositories/User_repository.php**
Expand All @@ -75,6 +73,8 @@ class User_repository extends Rougin\Credo\EntityRepository {

**NOTE**: Extending your repository to `Rougin\Credo\EntityRepository` enables you to call its methods in underscore case. (e.g. `find_all`, `find_by`)

You can now load a repository by using `$this->load->repository($repositoryName)`.

**application/controllers/Welcome.php**

``` php
Expand Down

0 comments on commit 8352e96

Please sign in to comment.