-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmultiple-filter-on-same-field-with-alternative.php
50 lines (48 loc) · 1.52 KB
/
multiple-filter-on-same-field-with-alternative.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
39
40
41
42
43
44
45
46
47
48
49
50
<?php
declare(strict_types=1);
// all posts whose title contains "foo" and "bar", or whose title contains "baz"
return [
'SELECT post1 FROM GraphQLTests\Doctrine\Blog\Model\Post post1 WHERE (post1.title LIKE :filter1 AND post1.title LIKE :filter2) OR post1.title LIKE :filter3',
\GraphQLTests\Doctrine\Blog\Model\Post::class,
[
'groups' => [
[
'groupLogic' => 'OR',
'conditionsLogic' => 'AND',
'conditions' => [
[
'title' => [
'like' => [
'value' => '%foo%',
'not' => false,
],
],
],
[
'title' => [
'like' => [
'value' => '%bar%',
'not' => false,
],
],
],
],
],
[
'groupLogic' => 'OR',
'conditionsLogic' => 'AND',
'conditions' => [
[
'title' => [
'like' => [
'value' => '%baz%',
'not' => false,
],
],
],
],
],
],
],
[],
];