@@ -149,6 +149,13 @@ class Statement
149
149
* @var bool
150
150
*/
151
151
private $ _failOnWarning = false ;
152
+
153
+ /**
154
+ * Whether or not the query should return profiling information
155
+ *
156
+ * @var bool
157
+ */
158
+ private $ _profile = false ;
152
159
153
160
/**
154
161
* Approximate memory limit value (in bytes) that a query can use on the server-side
@@ -202,6 +209,11 @@ class Statement
202
209
*/
203
210
const ENTRY_FAIL_ON_WARNING = 'failOnWarning ' ;
204
211
212
+ /**
213
+ * Profile flag
214
+ */
215
+ const ENTRY_PROFILE = 'profile ' ;
216
+
205
217
/**
206
218
* Memory limit threshold for query
207
219
*/
@@ -309,6 +321,10 @@ public function __construct(Connection $connection, array $data)
309
321
$ this ->_failOnWarning = (bool ) $ data [self ::ENTRY_FAIL_ON_WARNING ];
310
322
}
311
323
324
+ if (isset ($ data [self ::ENTRY_PROFILE ])) {
325
+ $ this ->_profile = (bool ) $ data [self ::ENTRY_PROFILE ];
326
+ }
327
+
312
328
if (isset ($ data [self ::ENTRY_MEMORY_LIMIT ])) {
313
329
$ this ->_memoryLimit = (int ) $ data [self ::ENTRY_MEMORY_LIMIT ];
314
330
}
@@ -658,6 +674,28 @@ public function getFailOnWarning()
658
674
return $ this ->_failOnWarning ;
659
675
}
660
676
677
+ /**
678
+ * Set whether or not query profiling should be enabled
679
+ *
680
+ * @param bool $value - value for profiling
681
+ *
682
+ * @return void
683
+ */
684
+ public function setProfile ($ value = true )
685
+ {
686
+ $ this ->_profile = (bool ) $ value ;
687
+ }
688
+
689
+ /**
690
+ * Get the configured value for profiling
691
+ *
692
+ * @return bool - current value of profiling option
693
+ */
694
+ public function getProfiling ()
695
+ {
696
+ return $ this ->_profile ;
697
+ }
698
+
661
699
/**
662
700
* Set the approximate memory limit threshold to be used by the query on the server-side
663
701
* (a value of 0 or less will mean the memory is not limited)
@@ -729,7 +767,8 @@ private function buildData()
729
767
self ::ENTRY_COUNT => $ this ->_doCount ,
730
768
'options ' => [
731
769
self ::FULL_COUNT => $ this ->_fullCount ,
732
- self ::ENTRY_FAIL_ON_WARNING => $ this ->_failOnWarning
770
+ self ::ENTRY_FAIL_ON_WARNING => $ this ->_failOnWarning ,
771
+ self ::ENTRY_PROFILE => $ this ->_profile
733
772
]
734
773
];
735
774
0 commit comments