@@ -18,7 +18,7 @@ class SybaseConnection extends Connection {
18
18
*
19
19
* @var array
20
20
*/
21
- private $ without_quotes = [
21
+ private $ withoutQuotes = [
22
22
'int ' ,
23
23
'numeric ' ,
24
24
'bigint ' ,
@@ -115,7 +115,7 @@ private function compileForSelect(Builder $builder, $bindings) {
115
115
array_push ($ arrTables , $ join ->table );
116
116
}
117
117
}
118
- $ new_format = [];
118
+ $ newFormat = [];
119
119
foreach ($ arrTables as $ tables ) {
120
120
preg_match ("/(?:(?'table'.*)(?: as )(?'alias'.*))|(?'tables'.*)/ " , $ tables , $ alias );
121
121
if (empty ($ alias ['alias ' ])) {
@@ -155,21 +155,21 @@ private function compileForSelect(Builder $builder, $bindings) {
155
155
for ($ ind = 0 ; $ ind < $ wheresCount ; $ ind ++) {
156
156
if (isset ($ wheres [$ ind ]['value ' ]) && isset ($ tipos [strtolower ($ wheres [$ ind ]['column ' ])])) {
157
157
if (is_object ($ wheres [$ ind ]['value ' ]) === false ) {
158
- if (in_array (strtolower ($ tipos [strtolower ($ wheres [$ ind ]['column ' ])]), $ this ->without_quotes )) {
158
+ if (in_array (strtolower ($ tipos [strtolower ($ wheres [$ ind ]['column ' ])]), $ this ->withoutQuotes )) {
159
159
if (!is_null ($ bindings [$ i ])) {
160
- $ new_binds [$ i ] = $ bindings [$ i ] / 1 ;
160
+ $ newBinds [$ i ] = $ bindings [$ i ] / 1 ;
161
161
} else {
162
- $ new_binds [$ i ] = null ;
162
+ $ newBinds [$ i ] = null ;
163
163
}
164
164
} else {
165
- $ new_binds [$ i ] = (string ) $ bindings [$ i ];
165
+ $ newBinds [$ i ] = (string ) $ bindings [$ i ];
166
166
}
167
167
$ i ++;
168
168
}
169
169
}
170
170
}
171
171
172
- $ new_format [$ tables ] = [];
172
+ $ newFormat [$ tables ] = [];
173
173
}
174
174
175
175
$ wheres = (array ) $ builder ->wheres ;
@@ -179,21 +179,21 @@ private function compileForSelect(Builder $builder, $bindings) {
179
179
for ($ ind = 0 ; $ ind < $ wheresCount ; $ ind ++) {
180
180
if (isset ($ wheres [$ ind ]['value ' ])) {
181
181
if (is_object ($ wheres [$ ind ]['value ' ]) === false ) {
182
- if (in_array (strtolower ($ tipos [strtolower ($ wheres [$ ind ]['column ' ])]), $ this ->without_quotes )) {
182
+ if (in_array (strtolower ($ tipos [strtolower ($ wheres [$ ind ]['column ' ])]), $ this ->withoutQuotes )) {
183
183
if (!is_null ($ bindings [$ i ])) {
184
- $ new_binds [$ i ] = $ bindings [$ i ] / 1 ;
184
+ $ newBinds [$ i ] = $ bindings [$ i ] / 1 ;
185
185
} else {
186
- $ new_binds [$ i ] = null ;
186
+ $ newBinds [$ i ] = null ;
187
187
}
188
188
} else {
189
- $ new_binds [$ i ] = (string ) $ bindings [$ i ];
189
+ $ newBinds [$ i ] = (string ) $ bindings [$ i ];
190
190
}
191
191
$ i ++;
192
192
}
193
193
}
194
194
}
195
195
196
- return $ new_binds ;
196
+ return $ newBinds ;
197
197
}
198
198
199
199
private function queryStringForSelect ($ tables )
@@ -257,7 +257,7 @@ private function queryStringForSelect($tables)
257
257
*
258
258
* @param string $query
259
259
* @param array $bindings
260
- * @return mixed $new_binds
260
+ * @return mixed $newBinds
261
261
*/
262
262
private function compileBindings ($ query , $ bindings )
263
263
{
@@ -266,7 +266,7 @@ private function compileBindings($query, $bindings)
266
266
}
267
267
268
268
$ bindings = $ this ->prepareBindings ($ bindings );
269
- $ new_format = [];
269
+ $ newFormat = [];
270
270
271
271
switch (explode (' ' , $ query )[0 ]) {
272
272
case "select " :
@@ -300,9 +300,9 @@ private function compileBindings($query, $bindings)
300
300
}
301
301
302
302
unset($ matches );
303
- unset($ query_type );
303
+ unset($ queryType );
304
304
preg_match_all ("/\[([^\]]*)\]/ " , $ desQuery ['attributes ' ], $ arrQuery );
305
- preg_match_all ("/\[([^\]]*)\]/ " , str_replace ( "].[].[ " , '.. ' , $ desQuery ['tables ' ]), $ arrTables );
305
+ preg_match_all ("/\[([^\]]*)\]/ " , str_replace ("].[].[ " , '.. ' , $ desQuery ['tables ' ]), $ arrTables );
306
306
307
307
$ arrQuery = $ arrQuery [1 ];
308
308
$ arrTables = $ arrTables [1 ];
@@ -322,37 +322,37 @@ private function compileBindings($query, $bindings)
322
322
if ($ numTables > 1 ) {
323
323
$ table = $ campos ;
324
324
}
325
- if (!array_key_exists ($ table , $ new_format )) {
325
+ if (!array_key_exists ($ table , $ newFormat )) {
326
326
$ queryRes = $ this ->getPdo ()->query ($ this ->queryStringForCompileBindings ($ table ));
327
327
$ types [$ table ] = $ queryRes ->fetchAll (\PDO ::FETCH_ASSOC );
328
328
for ($ k = 0 ; $ k < count ($ types [$ table ]); $ k ++) {
329
329
$ types [$ table ][$ types [$ table ][$ k ]['name ' ]] = $ types [$ table ][$ k ];
330
330
unset($ types [$ table ][$ k ]);
331
331
}
332
- $ new_format [$ table ] = [];
332
+ $ newFormat [$ table ] = [];
333
333
}
334
334
}
335
335
336
336
if (!$ itsTable ) {
337
337
if (count ($ bindings ) > $ ind ) {
338
- array_push ($ new_format [$ table ], ['campo ' => $ campos , 'binding ' => $ ind ]);
339
- if (in_array (strtolower ($ types [$ table ][$ campos ]['type ' ]), $ this ->without_quotes )) {
338
+ array_push ($ newFormat [$ table ], ['campo ' => $ campos , 'binding ' => $ ind ]);
339
+ if (in_array (strtolower ($ types [$ table ][$ campos ]['type ' ]), $ this ->withoutQuotes )) {
340
340
if (!is_null ($ bindings [$ ind ])) {
341
- $ new_binds [$ ind ] = $ bindings [$ ind ] / 1 ;
341
+ $ newBinds [$ ind ] = $ bindings [$ ind ] / 1 ;
342
342
} else {
343
- $ new_binds [$ ind ] = null ;
343
+ $ newBinds [$ ind ] = null ;
344
344
}
345
345
} else {
346
- $ new_binds [$ ind ] = (string ) $ bindings [$ ind ];
346
+ $ newBinds [$ ind ] = (string ) $ bindings [$ ind ];
347
347
}
348
348
} else {
349
- array_push ($ new_format [$ table ], ['campo ' => $ campos ]);
349
+ array_push ($ newFormat [$ table ], ['campo ' => $ campos ]);
350
350
}
351
351
$ ind ++;
352
352
}
353
353
}
354
354
355
- return $ new_binds ;
355
+ return $ newBinds ;
356
356
}
357
357
358
358
private function queryStringForCompileBindings ($ table )
@@ -459,19 +459,19 @@ public function compileOffset($offset, $query, $bindings = array(), $me)
459
459
$ queryString = $ this ->queryStringForPrimaries ($ from );
460
460
$ primaries = $ this ->getPdo ()->query ($ queryString )->fetchAll ($ me ->getFetchMode ());
461
461
foreach ($ primaries as $ primary ) {
462
- $ new_arr [] = $ primary ->primary_key . '+0 AS ' . $ primary ->primary_key ;
463
- $ where_arr [] = "#tmpPaginate. " . $ primary ->primary_key . ' = #tmpTable. ' . $ primary ->primary_key ;
462
+ $ newArr [] = $ primary ->primary_key . '+0 AS ' . $ primary ->primary_key ;
463
+ $ whereArr [] = "#tmpPaginate. " . $ primary ->primary_key . ' = #tmpTable. ' . $ primary ->primary_key ;
464
464
}
465
- $ res_primaries = implode (', ' , $ new_arr );
466
- $ where_primaries = implode (' AND ' , $ where_arr );
465
+ $ resPrimaries = implode (', ' , $ newArr );
466
+ $ wherePrimaries = implode (' AND ' , $ whereArr );
467
467
} else {
468
- $ res_primaries = $ identity ->column . '+0 AS ' . $ identity ->column ;
469
- $ where_primaries = "#tmpPaginate. " . $ identity ->column . ' = #tmpTable. ' . $ identity ->column ;
468
+ $ resPrimaries = $ identity ->column . '+0 AS ' . $ identity ->column ;
469
+ $ wherePrimaries = "#tmpPaginate. " . $ identity ->column . ' = #tmpTable. ' . $ identity ->column ;
470
470
// Offset operation
471
471
$ this ->getPdo ()->query (str_replace (" from " , " into #tmpPaginate from " , $ this ->compileNewQuery ($ query , $ bindings )));
472
472
$ this ->getPdo ()->query ("
473
473
SELECT
474
- " . $ res_primaries . ",
474
+ " . $ resPrimaries . ",
475
475
idTmp=identity(18)
476
476
INTO
477
477
#tmpTable
@@ -486,7 +486,7 @@ public function compileOffset($offset, $query, $bindings = array(), $me)
486
486
INNER JOIN
487
487
#tmpPaginate
488
488
ON
489
- " . $ where_primaries . "
489
+ " . $ wherePrimaries . "
490
490
WHERE
491
491
#tmpTable.idTmp BETWEEN " . ($ offset + 1 ) . " AND
492
492
" . ($ offset + $ limit ) . "
0 commit comments