Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Cassani committed Jan 8, 2018
1 parent 870b984 commit 311db3a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,55 @@ QueryBuilder::create($array);

```

## Data consistency

QueryBuilder checks for your data consistency. If an inconsistency is detected a `NotConsistentDataException` will be raised:

```php
use ArrayQuery\QueryBuilder;

$array = [
[
'id' => 1,
'title' => 'Leanne Graham',
'email' => '[email protected]',
'rate' => 5,
'company' => [
'name' => 'Romaguera-Jacobson',
'catchPhrase' => 'Face to face bifurcated interface',
'bs' => 'e-enable strategic applications'
]
],
[
'id' => 2,
'title' => 'Ervin Howell',
'email' => '[email protected]',
'rate' => 3,
'company' => [
'name' => 'Robel-Corkery',
'catchPhrase' => 'Multi-tiered zero tolerance productivity',
'bs' => 'transition cutting-edge web services'
]
],
[
'id' => 3,
'title' => 'Clementine Bauch',
'email' => '[email protected]',
'rate' => 4,
'company' => [
'name' => 'Keebler LLC',
'catchPhrase' => 'User-centric fault-tolerant solution',
'bs' => 'revolutionize end-to-end systems'
],
'extra-field' => 'this is an extra field'
],
]

// NotConsistentDataException will be raised
QueryBuilder::create($array);

```

## Quering, sorting and get results

You can perform queries on your array. You can concatenate criteria:
Expand Down

0 comments on commit 311db3a

Please sign in to comment.