@@ -457,9 +457,9 @@ private function queryStringForPrimaries($from)
457
457
*/
458
458
public function select ($ query , $ bindings = array (), $ useReadPdo = true )
459
459
{
460
- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings ) use ($ useReadPdo )
460
+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings ) use ($ useReadPdo )
461
461
{
462
- if ($ me ->pretending ()) {
462
+ if ($ this ->pretending ()) {
463
463
return array ();
464
464
}
465
465
@@ -470,18 +470,20 @@ public function select($query, $bindings = array(), $useReadPdo = true)
470
470
}
471
471
472
472
if ($ offset > 0 ) {
473
- return $ this ->compileOffset ($ offset , $ query , $ bindings , $ me );
473
+ return $ this ->compileOffset ($ offset , $ query , $ bindings , $ this );
474
474
} else {
475
475
$ result = [];
476
476
$ statement = $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ));
477
477
do {
478
- $ result += $ statement ->fetchAll ($ me ->getFetchMode ());
478
+ $ result += $ statement ->fetchAll ($ this ->getFetchMode ());
479
479
} while ($ statement ->nextRowset ());
480
480
return $ result ;
481
481
}
482
482
});
483
483
}
484
484
485
+
486
+
485
487
486
488
/**
487
489
* @param string $query
@@ -490,9 +492,9 @@ public function select($query, $bindings = array(), $useReadPdo = true)
490
492
*/
491
493
public function statement ($ query , $ bindings = array ())
492
494
{
493
- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings )
495
+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings )
494
496
{
495
- if ($ me ->pretending ()) {
497
+ if ($ this ->pretending ()) {
496
498
return true ;
497
499
}
498
500
return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ));
@@ -501,12 +503,22 @@ public function statement($query, $bindings = array())
501
503
502
504
public function affectingStatement ($ query , $ bindings = array ())
503
505
{
504
- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings )
506
+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings )
505
507
{
506
- if ($ me ->pretending ()) {
508
+ if ($ this ->pretending ()) {
507
509
return 0 ;
508
510
}
509
511
return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ))->rowCount ();
510
512
});
511
513
}
514
+
515
+ /**
516
+ * Get the default fetch mode for the connection.
517
+ *
518
+ * @return int
519
+ */
520
+ public function getFetchMode ()
521
+ {
522
+ return $ this ->fetchMode ;
523
+ }
512
524
}
0 commit comments