1 | <?php |
||
22 | class QueryBuilderRuleSet implements QueryBuilderConditionInterface, QueryBuilderRuleSetInterface { |
||
23 | |||
24 | /** |
||
25 | * Condition. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $condition; |
||
30 | |||
31 | /** |
||
32 | * Filter set. |
||
33 | * |
||
34 | * @var QueryBuilderFilterSetInterface |
||
35 | */ |
||
36 | private $filterSet; |
||
37 | |||
38 | /** |
||
39 | * Rules. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | private $rules; |
||
44 | |||
45 | /** |
||
46 | * Valid. |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $valid; |
||
51 | |||
52 | /** |
||
53 | * Constructor. |
||
54 | */ |
||
55 | public function __construct() { |
||
59 | |||
60 | /** |
||
61 | * Add a rule. |
||
62 | * |
||
63 | * @param QueryBuilderRuleInterface $rule The rule. |
||
64 | * @return QueryBuilderRuleSetInterface Returns this rule set. |
||
65 | */ |
||
66 | public function addRule(QueryBuilderRuleInterface $rule) { |
||
70 | |||
71 | /** |
||
72 | * Add a rule set. |
||
73 | * |
||
74 | * @param QueryBuilderRuleSetInterface $rule The rule. |
||
75 | * @return QueryBuilderRuleSetInterface Returns this rule set. |
||
76 | */ |
||
77 | public function addRuleSet(QueryBuilderRuleSetInterface $rule) { |
||
81 | |||
82 | /** |
||
83 | * Get the condition. |
||
84 | * |
||
85 | * @return string Returns the condition. |
||
86 | */ |
||
87 | public function getCondition() { |
||
90 | |||
91 | /** |
||
92 | * Get the filter set. |
||
93 | * |
||
94 | * @return QueryBuilderFilterSetInterface Returns the filter set. |
||
95 | */ |
||
96 | public function getFilterSet() { |
||
99 | |||
100 | /** |
||
101 | * Get the rules. |
||
102 | * |
||
103 | * @return array Returns the rules. |
||
104 | */ |
||
105 | public function getRules() { |
||
108 | |||
109 | /** |
||
110 | * Get the valid. |
||
111 | * |
||
112 | * @return bool Returns the valid. |
||
113 | */ |
||
114 | public function getValid() { |
||
117 | |||
118 | /** |
||
119 | * Set the condition. |
||
120 | * |
||
121 | * @param string $condition The condition. |
||
122 | * @return QueryBuilderRuleSetInterface Returns this rule set. |
||
123 | * @throws UnexpectedValueException Throws an unexpected value exception if the condition is invalid. |
||
124 | */ |
||
125 | public function setCondition($condition) { |
||
132 | |||
133 | /** |
||
134 | * Set the filter set. |
||
135 | * |
||
136 | * @param QueryBuilderFilterSetInterface $filterSet The filter set. |
||
137 | * @return QueryBuilderRuleSet Returns this rule set. |
||
138 | */ |
||
139 | protected function setFilterSet(QueryBuilderFilterSetInterface $filterSet) { |
||
143 | |||
144 | /** |
||
145 | * Set the rules. |
||
146 | * |
||
147 | * @param array $rules The rules. |
||
148 | * @return QueryBuilderRuleSet Returns this rule set. |
||
149 | */ |
||
150 | protected function setRules(array $rules) { |
||
154 | |||
155 | /** |
||
156 | * Set the valid. |
||
157 | * |
||
158 | * @param bool $valid The valid. |
||
159 | * @return QueryBuilderRuleSetInterface Returns this rule set. |
||
160 | */ |
||
161 | public function setValid($valid) { |
||
165 | } |
||
166 |