From 67588d1f5f7539a2a61e64f58f20fc129685daac Mon Sep 17 00:00:00 2001 From: Brad Kent Date: Sun, 16 Jun 2024 15:40:45 -0500 Subject: [PATCH] StatementInfo update omitted from previous commit --- src/Debug/Collector/StatementInfo.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Debug/Collector/StatementInfo.php b/src/Debug/Collector/StatementInfo.php index 8f24a2ee..8e6e399c 100644 --- a/src/Debug/Collector/StatementInfo.php +++ b/src/Debug/Collector/StatementInfo.php @@ -91,6 +91,9 @@ class StatementInfo extends AbstractComponent /** @var array */ protected static $constants = array(); + /** @var int */ + protected static $id = 0; + /** * @param string $sql SQL * @param array $params bound params @@ -140,6 +143,7 @@ public function appendLog(Debug $debug) $debug->groupCollapsed($label, $debug->meta(array( 'boldLabel' => false, 'icon' => $debug->getCfg('channelIcon', Debug::CONFIG_DEBUG), + 'id' => 'statementInfo' . (++ self::$id), ))); $this->logQuery($label); $this->logParams(); @@ -178,6 +182,16 @@ public function end(Exception $exception = null, $rowCount = null) $this->isSuccess = $exception === null; } + /** + * Return the value of the previously output id attribute + * + * @return string + */ + public static function lastGroupId() + { + return 'statementInfo' . self::$id; + } + /** * Set query's duration *