Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| QueryObject | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Projom\Storage\SQL; |
| 6 | |
| 7 | use Stringable; |
| 8 | |
| 9 | /** |
| 10 | * DTO for a sql query. |
| 11 | */ |
| 12 | class QueryObject implements Stringable |
| 13 | { |
| 14 | public function __construct( |
| 15 | public array $collections, |
| 16 | public array $fields = [], |
| 17 | public array $fieldsWithValues = [], |
| 18 | public array $joins = [], |
| 19 | public array $filters = [], |
| 20 | public array $sorts = [], |
| 21 | public array $groups = [], |
| 22 | public null|int $limit = null, |
| 23 | public null|int $offset = null, |
| 24 | public array $formatting = [], |
| 25 | ) {} |
| 26 | |
| 27 | public function __toString() |
| 28 | { |
| 29 | return json_encode($this); |
| 30 | } |
| 31 | } |