Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
midorikocak committed Feb 3, 2020
1 parent 4537c10 commit 90febf8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .phpcs-cache

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ Returns affected rows. If id does not exist, throws exception.
$db->delete($tableName)->delete('id', $id)->execute();
```

## CrudInterface
## RepositoryInterface

The crud interface is the interface of repositories.
The repository interface is the interface of repositories.

```php
<?php
Expand All @@ -120,17 +120,21 @@ declare(strict_types=1);

namespace midorikocak\nanodb;

interface CrudInterface
interface RepositoryInterface
{
public function read(string $id);

public function readAll(array $constraints = [], array $columns = []): array;
public function readAll(
array $filter = [],
array $columns = ['*'],
?int $limit = null,
?int $offset = null
): array;

public function save($item);

public function remove($data): int;
}

```

If you want to use arrays to interact with your database, you can use the array repository.
Expand Down

0 comments on commit 90febf8

Please sign in to comment.