@@ -113,11 +113,12 @@ function createCertificate(
113113 *
114114 * @param strings $y, - The right expression.
115115 * @param strings $and, - combine additional expressions with, 'AND','OR', 'NOT', 'AND NOT'.
116+ * @param strings $group, - notes beginning or end of where group, '(',')'.
116117 * @param strings $args - for any extras
117118 *
118- * function comparison($x, $operator, $y, $and=null, ...$args)
119+ * function comparison($x, $operator, $y, $and=null, $group=null, ...$args)
119120 * {
120- * return array($x, $operator, $y, $and, ...$args);
121+ * return array($x, $operator, $y, $and, $group, ...$args);
121122 * }
122123 *
123124 * @return array
@@ -126,110 +127,110 @@ function createCertificate(
126127 /**
127128 * Creates an equality comparison expression with the given arguments.
128129 */
129- function eq ($ x , $ y , $ and = null , ...$ args )
130+ function eq ($ x , $ y , $ and = null , $ group = null , ...$ args )
130131 {
131132 $ expression = array ();
132- \array_push ($ expression , $ x , \EQ , $ y , $ and , ...$ args );
133+ \array_push ($ expression , $ x , \EQ , $ y , $ and , $ group , ...$ args );
133134 return $ expression ;
134135 }
135136
136137 /**
137138 * Creates a non equality comparison expression with the given arguments.
138139 */
139- function neq ($ x , $ y , $ and = null , ...$ args )
140+ function neq ($ x , $ y , $ and = null , $ group = null , ...$ args )
140141 {
141142 $ expression = array ();
142- \array_push ($ expression , $ x , \NEQ , $ y , $ and , ...$ args );
143+ \array_push ($ expression , $ x , \NEQ , $ y , $ and , $ group , ...$ args );
143144 return $ expression ;
144145 }
145146
146147 /**
147148 * Creates the other non equality comparison expression with the given arguments.
148149 */
149- function ne ($ x , $ y , $ and = null , ...$ args )
150+ function ne ($ x , $ y , $ and = null , $ group = null , ...$ args )
150151 {
151152 $ expression = array ();
152- \array_push ($ expression , $ x , \NE , $ y , $ and , ...$ args );
153+ \array_push ($ expression , $ x , \NE , $ y , $ and , $ group , ...$ args );
153154 return $ expression ;
154155 }
155156
156157 /**
157158 * Creates a lower-than comparison expression with the given arguments.
158159 */
159- function lt ($ x , $ y , $ and = null , ...$ args )
160+ function lt ($ x , $ y , $ and = null , $ group = null , ...$ args )
160161 {
161162 $ expression = array ();
162- \array_push ($ expression , $ x , \LT , $ y , $ and , ...$ args );
163+ \array_push ($ expression , $ x , \LT , $ y , $ and , $ group , ...$ args );
163164 return $ expression ;
164165 }
165166
166167 /**
167168 * Creates a lower-than-equal comparison expression with the given arguments.
168169 */
169- function lte ($ x , $ y , $ and = null , ...$ args )
170+ function lte ($ x , $ y , $ and = null , $ group = null , ...$ args )
170171 {
171172 $ expression = array ();
172- \array_push ($ expression , $ x , \LTE , $ y , $ and , ...$ args );
173+ \array_push ($ expression , $ x , \LTE , $ y , $ and , $ group , ...$ args );
173174 return $ expression ;
174175 }
175176
176177 /**
177178 * Creates a greater-than comparison expression with the given arguments.
178179 */
179- function gt ($ x , $ y , $ and = null , ...$ args )
180+ function gt ($ x , $ y , $ and = null , $ group = null , ...$ args )
180181 {
181182 $ expression = array ();
182- \array_push ($ expression , $ x , \GT , $ y , $ and , ...$ args );
183+ \array_push ($ expression , $ x , \GT , $ y , $ and , $ group , ...$ args );
183184 return $ expression ;
184185 }
185186
186187 /**
187188 * Creates a greater-than-equal comparison expression with the given arguments.
188189 */
189- function gte ($ x , $ y , $ and = null , ...$ args )
190+ function gte ($ x , $ y , $ and = null , $ group = null , ...$ args )
190191 {
191192 $ expression = array ();
192- \array_push ($ expression , $ x , \GTE , $ y , $ and , ...$ args );
193+ \array_push ($ expression , $ x , \GTE , $ y , $ and , $ group , ...$ args );
193194 return $ expression ;
194195 }
195196
196197 /**
197198 * Creates an IS NULL expression with the given arguments.
198199 */
199- function isNull ($ x , $ y = 'null ' , $ and = null , ...$ args )
200+ function isNull ($ x , $ y = 'null ' , $ and = null , $ group = null , ...$ args )
200201 {
201202 $ expression = array ();
202- \array_push ($ expression , $ x , \_isNULL, $ y , $ and , ...$ args );
203+ \array_push ($ expression , $ x , \_isNULL, $ y , $ and , $ group , ...$ args );
203204 return $ expression ;
204205 }
205206
206207 /**
207208 * Creates an IS NOT NULL expression with the given arguments.
208209 */
209- function isNotNull ($ x , $ y = 'null ' , $ and = null , ...$ args )
210+ function isNotNull ($ x , $ y = 'null ' , $ and = null , $ group = null , ...$ args )
210211 {
211212 $ expression = array ();
212- \array_push ($ expression , $ x , \_notNULL, $ y , $ and , ...$ args );
213+ \array_push ($ expression , $ x , \_notNULL, $ y , $ and , $ group , ...$ args );
213214 return $ expression ;
214215 }
215216
216217 /**
217218 * Creates a LIKE() comparison expression with the given arguments.
218219 */
219- function like ($ x , $ y , $ and = null , ...$ args )
220+ function like ($ x , $ y , $ and = null , $ group = null , ...$ args )
220221 {
221222 $ expression = array ();
222- \array_push ($ expression , $ x , \_LIKE , $ y , $ and , ...$ args );
223+ \array_push ($ expression , $ x , \_LIKE , $ y , $ and , $ group , ...$ args );
223224 return $ expression ;
224225 }
225226
226227 /**
227228 * Creates a NOT LIKE() comparison expression with the given arguments.
228229 */
229- function notLike ($ x , $ y , $ and = null , ...$ args )
230+ function notLike ($ x , $ y , $ and = null , $ group = null , ...$ args )
230231 {
231232 $ expression = array ();
232- \array_push ($ expression , $ x , \_notLIKE, $ y , $ and , ...$ args );
233+ \array_push ($ expression , $ x , \_notLIKE, $ y , $ and , $ group , ...$ args );
233234 return $ expression ;
234235 }
235236
@@ -349,6 +350,14 @@ function where(...$args)
349350 : false ;
350351 }
351352
353+ function whereGroup (...$ args )
354+ {
355+ $ ezQuery = \getInstance ();
356+ return ($ ezQuery instanceof DatabaseInterface)
357+ ? $ ezQuery ->whereGroup (...$ args )
358+ : false ;
359+ }
360+
352361 function groupBy ($ groupBy )
353362 {
354363 $ ezQuery = \getInstance ();
@@ -374,7 +383,7 @@ function innerJoin(
374383 $ condition = \EQ
375384 ) {
376385 $ ezQuery = \getInstance ();
377- return ($ ezQuery instanceOf DatabaseInterface)
386+ return ($ ezQuery instanceof DatabaseInterface)
378387 ? $ ezQuery ->innerJoin ($ leftTable , $ rightTable , $ leftColumn , $ rightColumn , $ tableAs , $ condition )
379388 : false ;
380389 }
@@ -388,7 +397,7 @@ function leftJoin(
388397 $ condition = \EQ
389398 ) {
390399 $ ezQuery = \getInstance ();
391- return ($ ezQuery instanceOf DatabaseInterface)
400+ return ($ ezQuery instanceof DatabaseInterface)
392401 ? $ ezQuery ->leftJoin ($ leftTable , $ rightTable , $ leftColumn , $ rightColumn , $ tableAs , $ condition )
393402 : false ;
394403 }
@@ -402,7 +411,7 @@ function rightJoin(
402411 $ condition = \EQ
403412 ) {
404413 $ ezQuery = \getInstance ();
405- return ($ ezQuery instanceOf DatabaseInterface)
414+ return ($ ezQuery instanceof DatabaseInterface)
406415 ? $ ezQuery ->rightJoin ($ leftTable , $ rightTable , $ leftColumn , $ rightColumn , $ tableAs , $ condition )
407416 : false ;
408417 }
@@ -416,7 +425,7 @@ function fullJoin(
416425 $ condition = \EQ
417426 ) {
418427 $ ezQuery = \getInstance ();
419- return ($ ezQuery instanceOf DatabaseInterface)
428+ return ($ ezQuery instanceof DatabaseInterface)
420429 ? $ ezQuery ->fullJoin ($ leftTable , $ rightTable , $ leftColumn , $ rightColumn , $ tableAs , $ condition )
421430 : false ;
422431 }
0 commit comments