diff --git a/lib/Doctrine/DBAL/Driver/LastInsertId.php b/lib/Doctrine/DBAL/Driver/LastInsertId.php index 2b3a6e59130..74a62cc52e9 100644 --- a/lib/Doctrine/DBAL/Driver/LastInsertId.php +++ b/lib/Doctrine/DBAL/Driver/LastInsertId.php @@ -19,7 +19,7 @@ public function get() : string return $this->value; } - public function set(string $value) : void + public function register(string $value) : void { // The last insert ID is reset to "0" in certain situations by some implementations, // therefore we keep the previously set insert ID locally. diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php index e0ae6a8e71d..0e4d71c2bc9 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php @@ -173,7 +173,7 @@ public function exec($statement) throw new MysqliException($this->_conn->error, $this->_conn->sqlstate, $this->_conn->errno); } - $this->lastInsertId->set((string) $this->_conn->insert_id); + $this->lastInsertId->register((string) $this->_conn->insert_id); return $this->_conn->affected_rows; } diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index c830fe2c3a0..6d662918ced 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -185,7 +185,7 @@ public function execute($params = null) throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno); } - $this->lastInsertId->set((string) $this->_conn->insert_id); + $this->lastInsertId->register((string) $this->_conn->insert_id); if (null === $this->_columnNames) { $meta = $this->_stmt->result_metadata(); diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 43fdc9ccec8..93d34ea6414 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -199,7 +199,7 @@ public function trackLastInsertId() : void return; } - $this->lastInsertId->set($lastInsertId); + $this->lastInsertId->register($lastInsertId); } /**