Skip to content

Commit

Permalink
StatementInfo update omitted from previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bkdotcom committed Jun 16, 2024
1 parent 7ed5d4f commit 67588d1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Debug/Collector/StatementInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class StatementInfo extends AbstractComponent
/** @var array<int,string> */
protected static $constants = array();

/** @var int */
protected static $id = 0;

/**
* @param string $sql SQL
* @param array $params bound params
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 67588d1

Please sign in to comment.