1 | <?php |
||
21 | class FilteredQuery implements BuilderInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var BuilderInterface |
||
25 | */ |
||
26 | private $query; |
||
27 | |||
28 | /** |
||
29 | * @var BuilderInterface |
||
30 | */ |
||
31 | private $filter; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $boolFilter; |
||
37 | |||
38 | /** |
||
39 | * @param BuilderInterface $query |
||
40 | * @param BuilderInterface $filter |
||
41 | */ |
||
42 | public function __construct(BuilderInterface $query = null, BuilderInterface $filter = null) |
||
47 | |||
48 | /** |
||
49 | * adds a query to join with AND operator |
||
50 | * |
||
51 | * @param BuilderInterface $must |
||
52 | * @param BuilderInterface $should |
||
53 | * @param BuilderInterface $mustNot |
||
54 | */ |
||
55 | public function addBoolFilter( |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function getType() |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function toArray() |
||
101 | } |
||
102 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: