@@ -457,9 +457,9 @@ private function queryStringForPrimaries($from)
457457 */
458458 public function select ($ query , $ bindings = array (), $ useReadPdo = true )
459459 {
460- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings ) use ($ useReadPdo )
460+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings ) use ($ useReadPdo )
461461 {
462- if ($ me ->pretending ()) {
462+ if ($ this ->pretending ()) {
463463 return array ();
464464 }
465465
@@ -470,18 +470,20 @@ public function select($query, $bindings = array(), $useReadPdo = true)
470470 }
471471
472472 if ($ offset > 0 ) {
473- return $ this ->compileOffset ($ offset , $ query , $ bindings , $ me );
473+ return $ this ->compileOffset ($ offset , $ query , $ bindings , $ this );
474474 } else {
475475 $ result = [];
476476 $ statement = $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ));
477477 do {
478- $ result += $ statement ->fetchAll ($ me ->getFetchMode ());
478+ $ result += $ statement ->fetchAll ($ this ->getFetchMode ());
479479 } while ($ statement ->nextRowset ());
480480 return $ result ;
481481 }
482482 });
483483 }
484484
485+
486+
485487
486488 /**
487489 * @param string $query
@@ -490,9 +492,9 @@ public function select($query, $bindings = array(), $useReadPdo = true)
490492 */
491493 public function statement ($ query , $ bindings = array ())
492494 {
493- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings )
495+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings )
494496 {
495- if ($ me ->pretending ()) {
497+ if ($ this ->pretending ()) {
496498 return true ;
497499 }
498500 return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ));
@@ -501,12 +503,22 @@ public function statement($query, $bindings = array())
501503
502504 public function affectingStatement ($ query , $ bindings = array ())
503505 {
504- return $ this ->run ($ query , $ bindings , function ($ me , $ query , $ bindings )
506+ return $ this ->run ($ query , $ bindings , function ($ query , $ bindings )
505507 {
506- if ($ me ->pretending ()) {
508+ if ($ this ->pretending ()) {
507509 return 0 ;
508510 }
509511 return $ this ->getPdo ()->query ($ this ->compileNewQuery ($ query , $ bindings ))->rowCount ();
510512 });
511513 }
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+ }
512524}
0 commit comments