@@ -135,6 +135,145 @@ public static function getQueries(\PHPCR\Query\QOM\QueryObjectModelFactoryInterf
135
135
array (),
136
136
array ());
137
137
138
+ /**
139
+ * 6.7.12. Constraint (operator precedence)
140
+ */
141
+ $ queries ['6.7.12.Constraint.Precedence.1 ' ] = $ factory ->createQuery (
142
+ $ factory ->selector ('nt:file ' ),
143
+ $ factory ->orConstraint (
144
+ $ factory ->comparison (
145
+ $ factory ->propertyValue ('prop1 ' , 'sel1 ' ),
146
+ Constants::JCR_OPERATOR_EQUAL_TO ,
147
+ $ factory ->literal ('1 ' )
148
+ ),
149
+ $ factory ->andConstraint (
150
+ $ factory ->comparison (
151
+ $ factory ->propertyValue ('prop2 ' , 'sel1 ' ),
152
+ Constants::JCR_OPERATOR_EQUAL_TO ,
153
+ $ factory ->literal ('2 ' )
154
+ ),
155
+ $ factory ->comparison (
156
+ $ factory ->propertyValue ('prop3 ' , 'sel1 ' ),
157
+ Constants::JCR_OPERATOR_EQUAL_TO ,
158
+ $ factory ->literal ('3 ' )
159
+ )
160
+ )
161
+ ),
162
+ array (),
163
+ array ()
164
+ );
165
+
166
+ $ queries ['6.7.12.Constraint.Precedence.2 ' ] = $ factory ->createQuery (
167
+ $ factory ->selector ('nt:file ' ),
168
+ $ factory ->orConstraint (
169
+ $ factory ->andConstraint (
170
+ $ factory ->comparison (
171
+ $ factory ->propertyValue ('prop1 ' , 'sel1 ' ),
172
+ Constants::JCR_OPERATOR_EQUAL_TO ,
173
+ $ factory ->literal ('1 ' )
174
+ ),
175
+ $ factory ->comparison (
176
+ $ factory ->propertyValue ('prop2 ' , 'sel1 ' ),
177
+ Constants::JCR_OPERATOR_EQUAL_TO ,
178
+ $ factory ->literal ('2 ' )
179
+ )
180
+ ),
181
+ $ factory ->comparison (
182
+ $ factory ->propertyValue ('prop3 ' , 'sel1 ' ),
183
+ Constants::JCR_OPERATOR_EQUAL_TO ,
184
+ $ factory ->literal ('3 ' )
185
+ )
186
+ ),
187
+ array (),
188
+ array ()
189
+ );
190
+
191
+ $ queries ['6.7.12.Constraint.Precedence.3 ' ] = $ factory ->createQuery (
192
+ $ factory ->selector ('nt:file ' ),
193
+ $ factory ->orConstraint (
194
+ $ factory ->notConstraint (
195
+ $ factory ->comparison (
196
+ $ factory ->propertyValue ('prop1 ' , 'sel1 ' ),
197
+ Constants::JCR_OPERATOR_EQUAL_TO ,
198
+ $ factory ->literal ('1 ' )
199
+ )
200
+ ),
201
+ $ factory ->andConstraint (
202
+ $ factory ->comparison (
203
+ $ factory ->propertyValue ('prop2 ' , 'sel1 ' ),
204
+ Constants::JCR_OPERATOR_EQUAL_TO ,
205
+ $ factory ->literal ('2 ' )
206
+ ),
207
+ $ factory ->notConstraint (
208
+ $ factory ->comparison (
209
+ $ factory ->propertyValue ('prop3 ' , 'sel1 ' ),
210
+ Constants::JCR_OPERATOR_EQUAL_TO ,
211
+ $ factory ->literal ('3 ' )
212
+ )
213
+ )
214
+ )
215
+ ),
216
+ array (),
217
+ array ()
218
+ );
219
+
220
+ $ queries ['6.7.12.Constraint.Precedence.4 ' ] = $ factory ->createQuery (
221
+ $ factory ->selector ('nt:file ' ),
222
+ $ factory ->orConstraint (
223
+ $ factory ->andConstraint (
224
+ $ factory ->andConstraint (
225
+ $ factory ->propertyExistence ('prop1 ' , 'sel1 ' ),
226
+ $ factory ->propertyExistence ('prop2 ' , 'sel1 ' )
227
+ ),
228
+ $ factory ->propertyExistence ('prop3 ' , 'sel1 ' )
229
+ ),
230
+ $ factory ->andConstraint (
231
+ $ factory ->andConstraint (
232
+ $ factory ->andConstraint (
233
+ $ factory ->propertyExistence ('prop4 ' , 'sel1 ' ),
234
+ $ factory ->propertyExistence ('prop5 ' , 'sel1 ' )
235
+ ),
236
+ $ factory ->propertyExistence ('prop6 ' , 'sel1 ' )
237
+ ),
238
+ $ factory ->propertyExistence ('prop7 ' , 'sel1 ' )
239
+ )
240
+ ),
241
+ array (),
242
+ array ()
243
+ );
244
+
245
+ $ queries ['6.7.12.Constraint.Precedence.5 ' ] = $ factory ->createQuery (
246
+ $ factory ->selector ('nt:file ' ),
247
+ $ factory ->orConstraint (
248
+ $ factory ->andConstraint (
249
+ $ factory ->notConstraint (
250
+ $ factory ->propertyExistence ('prop1 ' , 'sel1 ' )
251
+ ),
252
+ $ factory ->notConstraint (
253
+ $ factory ->notConstraint (
254
+ $ factory ->propertyExistence ('prop2 ' , 'sel1 ' )
255
+ )
256
+ )
257
+ ),
258
+ $ factory ->andConstraint (
259
+ $ factory ->notConstraint (
260
+ $ factory ->comparison (
261
+ $ factory ->propertyValue ('prop3 ' , 'sel1 ' ),
262
+ Constants::JCR_OPERATOR_EQUAL_TO ,
263
+ $ factory ->literal ('hello ' )
264
+ )
265
+ ),
266
+ $ factory ->comparison (
267
+ $ factory ->propertyValue ('prop4 ' , 'sel1 ' ),
268
+ Constants::JCR_OPERATOR_NOT_EQUAL_TO ,
269
+ $ factory ->literal ('hello ' )
270
+ )
271
+ )
272
+ ),
273
+ array (),
274
+ array ()
275
+ );
276
+
138
277
/**
139
278
* 6.7.13. AndConstraint
140
279
*/
0 commit comments