From 9df32a24239d39b0d7314c0360037845ef6e14dd Mon Sep 17 00:00:00 2001 From: Ou Bo Date: Fri, 27 Oct 2023 21:09:21 +0800 Subject: [PATCH] Update QueryBuilder.php Add number of rows affected by the executeResetSequence. --- framework/db/QueryBuilder.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/db/QueryBuilder.php b/framework/db/QueryBuilder.php index 114116e67c5..b821260b91d 100644 --- a/framework/db/QueryBuilder.php +++ b/framework/db/QueryBuilder.php @@ -1054,12 +1054,13 @@ public function resetSequence($table, $value = null) * @param string $table the name of the table whose primary key sequence is reset * @param array|string|null $value the value for the primary key of the next new row inserted. If this is not set, * the next new row's primary key will have the maximum existing value +1. + * @return int number of rows affected by the execution. * @throws NotSupportedException if this is not supported by the underlying DBMS * @since 2.0.16 */ public function executeResetSequence($table, $value = null) { - $this->db->createCommand()->resetSequence($table, $value)->execute(); + return $this->db->createCommand()->resetSequence($table, $value)->execute(); } /**