@@ -41,34 +41,32 @@ public function __call($method, $parameters)
41
41
$ start = microtime (true );
42
42
$ result = call_user_func_array ([$ this ->collection , $ method ], $ parameters );
43
43
44
- if ($ this ->connection ->logging ()) {
45
- // Once we have run the query we will calculate the time that it took to run and
46
- // then log the query, bindings, and execution time so we will report them on
47
- // the event that the developer needs them. We'll log time in milliseconds.
48
- $ time = $ this ->connection ->getElapsedTime ($ start );
44
+ // Once we have run the query we will calculate the time that it took to run and
45
+ // then log the query, bindings, and execution time so we will report them on
46
+ // the event that the developer needs them. We'll log time in milliseconds.
47
+ $ time = $ this ->connection ->getElapsedTime ($ start );
49
48
50
- $ query = [];
49
+ $ query = [];
51
50
52
- // Convert the query parameters to a json string.
53
- array_walk_recursive ($ parameters , function (&$ item , $ key ) {
54
- if ($ item instanceof ObjectID) {
55
- $ item = (string ) $ item ;
56
- }
57
- });
51
+ // Convert the query parameters to a json string.
52
+ array_walk_recursive ($ parameters , function (&$ item , $ key ) {
53
+ if ($ item instanceof ObjectID) {
54
+ $ item = (string ) $ item ;
55
+ }
56
+ });
58
57
59
- // Convert the query parameters to a json string.
60
- foreach ($ parameters as $ parameter ) {
61
- try {
62
- $ query [] = json_encode ($ parameter );
63
- } catch (Exception $ e ) {
64
- $ query [] = '{...} ' ;
65
- }
58
+ // Convert the query parameters to a json string.
59
+ foreach ($ parameters as $ parameter ) {
60
+ try {
61
+ $ query [] = json_encode ($ parameter );
62
+ } catch (Exception $ e ) {
63
+ $ query [] = '{...} ' ;
66
64
}
65
+ }
67
66
68
- $ queryString = $ this ->collection ->getCollectionName () . '. ' . $ method . '( ' . implode (', ' , $ query ) . ') ' ;
67
+ $ queryString = $ this ->collection ->getCollectionName () . '. ' . $ method . '( ' . implode (', ' , $ query ) . ') ' ;
69
68
70
- $ this ->connection ->logQuery ($ queryString , [], $ time );
71
- }
69
+ $ this ->connection ->logQuery ($ queryString , [], $ time );
72
70
73
71
return $ result ;
74
72
}
0 commit comments