-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathFilter.php
38 lines (33 loc) · 920 Bytes
/
Filter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/*
* Copyright 2024 Cloud Creativity Limited
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
*/
declare(strict_types=1);
namespace LaravelJsonApi\Eloquent\Contracts;
use Illuminate\Database\Eloquent\Builder;
use LaravelJsonApi\Contracts\Schema\Filter as BaseFilter;
use LaravelJsonApi\Validation\Filters\IsValidated;
interface Filter extends BaseFilter, IsValidated
{
/**
* Does the filter return a singular resource?
*
* Return `true` if the filter will return a singular resource, rather than a list
* of resources.
*
* @return bool
*/
public function isSingular(): bool;
/**
* Apply the filter to the query.
*
* @param Builder $query
* @param mixed $value
* @return Builder
*/
public function apply($query, $value);
}