1 | <?php |
||
14 | class CriteriaSet |
||
15 | { |
||
16 | /** @var array|CriteriaInterface[] */ |
||
17 | protected $criterions = array(); |
||
18 | |||
19 | /** |
||
20 | * @param CriteriaInterface[] $criterions |
||
21 | */ |
||
22 | 32 | public function __construct(array $criterions = array()) |
|
28 | |||
29 | /** |
||
30 | * @param CriteriaInterface $criteria |
||
31 | * |
||
32 | * @return CriteriaSet |
||
33 | */ |
||
34 | 43 | public function add(CriteriaInterface $criteria) |
|
40 | |||
41 | /** |
||
42 | * @param CriteriaInterface $criteria |
||
43 | * |
||
44 | * @return CriteriaSet |
||
45 | */ |
||
46 | 1 | public function addIfNone(CriteriaInterface $criteria) |
|
54 | |||
55 | /** |
||
56 | * @param CriteriaSet $criteriaSet |
||
57 | * |
||
58 | * @return CriteriaSet |
||
59 | */ |
||
60 | 1 | public function addAll(CriteriaSet $criteriaSet) |
|
68 | |||
69 | /** |
||
70 | * @param mixed $condition |
||
71 | * @param callable $callback |
||
72 | * |
||
73 | * @return CriteriaSet |
||
74 | */ |
||
75 | 7 | public function addIf($condition, $callback) |
|
86 | |||
87 | /** |
||
88 | * @return CriteriaInterface[]|array |
||
89 | */ |
||
90 | 3 | public function all() |
|
94 | |||
95 | /** |
||
96 | * @param string $class |
||
97 | * |
||
98 | * @return array|CriteriaInterface[] |
||
99 | */ |
||
100 | 15 | public function get($class) |
|
111 | |||
112 | /** |
||
113 | * @param string $class |
||
114 | * |
||
115 | * @return CriteriaInterface|null |
||
116 | */ |
||
117 | 14 | public function getSingle($class) |
|
127 | |||
128 | /** |
||
129 | * @param string $class |
||
130 | * |
||
131 | * @return bool |
||
132 | */ |
||
133 | 32 | public function has($class) |
|
143 | } |
||
144 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.