-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mauro Cassani
committed
Jan 8, 2018
1 parent
870b984
commit 311db3a
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|