Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ItemQueryBuilder | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| search | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\Item\QueryBuilders; |
| 4 | |
| 5 | use Domain\Item\DTOs\ItemSearchDTO; |
| 6 | use Illuminate\Database\Eloquent\Builder; |
| 7 | |
| 8 | class ItemQueryBuilder extends Builder |
| 9 | { |
| 10 | |
| 11 | /** |
| 12 | * @param ItemSearchDTO $itemSearchDTO |
| 13 | * @return $this |
| 14 | */ |
| 15 | public function search(ItemSearchDTO $itemSearchDTO): static |
| 16 | { |
| 17 | if ($itemSearchDTO->product) { |
| 18 | $this->where('product_id', $itemSearchDTO->product); |
| 19 | } |
| 20 | |
| 21 | return $this; |
| 22 | } |
| 23 | } |