File tree Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Expand file tree Collapse file tree 1 file changed +2
-28
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ public function addValue($value)
183
183
static $ count = 0 ;
184
184
$ count ++;
185
185
186
- $ placeholder = ":!! val $ count!!: " ; // sqlite plugin does not support named parameters, yet so we have simulate it
186
+ $ placeholder = ":val $ count" ;
187
187
$ this ->values [$ placeholder ] = $ value ;
188
188
return $ placeholder ;
189
189
}
@@ -241,33 +241,7 @@ public function getSQL()
241
241
'ORDER BY ' . implode (", \n" , $ this ->orderby ) . "\n" ;
242
242
}
243
243
244
- return $ this ->fixPlaceholders ($ sql );
245
- }
246
-
247
- /**
248
- * Replaces the named placeholders with ? placeholders
249
- *
250
- * Until the sqlite plugin can use named placeholder properly
251
- *
252
- * @param string $sql
253
- * @return array
254
- */
255
- protected function fixPlaceholders ($ sql )
256
- {
257
- $ vals = [];
258
-
259
- while (preg_match ('/(:!!val\d+!!:)/ ' , $ sql , $ m )) {
260
- $ pl = $ m [1 ];
261
-
262
- if (!array_key_exists ($ pl , $ this ->values )) {
263
- throw new StructException ('Placeholder not found ' );
264
- }
265
-
266
- $ sql = preg_replace ("/ $ pl/ " , '? ' , $ sql , 1 );
267
- $ vals [] = $ this ->values [$ pl ];
268
- }
269
-
270
- return [$ sql , $ vals ];
244
+ return [$ sql , $ this ->values ];
271
245
}
272
246
273
247
/**
You can’t perform that action at this time.
0 commit comments