---
title: "Breaking: #102875 - Changed Connection method signatures and behaviour"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:breaking-102875-1705944556"
source: "Changelog/13.0/Breaking-102875-ChangedConnectionMethodSignaturesAndBehaviour.rst"
typo3-version: "13.0"
typo3-major: 13
type: "breaking"
issue: 102875
forge: "https://forge.typo3.org/issues/102875"
tags: ["Database", "PHP-API", "NotScanned", "ext:core"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Breaking: #102875 - Changed Connection method signatures and behaviour {#breaking-102875-1705944556}

See [forge#102875](https://forge.typo3.org/issues/102875)

## Description {#description}

Signature and behaviour of following methods has been changed:

-   `lastInsertId()` no longer accepts the sequence and field name.
-   `quote()` no longer has a type argument and the value must be a string.

Public `Connection::PARAM_*` class constants has been replaced with the
Doctrine DBAL 4 `ParameterType` and `ArrayParameterType` enum definitions.

> [!NOTE]
> Doctrine DBAL dropped the support for using the `\PDO::PARAM_*` constants in
> favour of the enum types on several methods. Be aware of this and use the
> `\TYPO3\CMS\Core\Database\Connection::PARAM_*` constants to reduce
> required work on upgrading.

## Impact {#impact}

Calling `quote()` with a non-string as first argument will result in a
PHP error. Still providing the second argument will not emit an error, but
may be detected by static code analysers.

Calling `lastInsertId()` not directly after the record insert or inserting
records in another table in between will return the incorrect value.

## Affected installations {#affected-installations}

Only installations calling `quote()` with a non-string as first argument
or not using `lastInsertId()` directly after the record insert.

## Migration {#migration}

### `lastInsertId()` {#php-lastinsertid}

Returns the last inserted ID (auto-created) on the connection.

> [!NOTE]
> That means, that the `last inserted id` needs to be retrieved directly before
> inserting a record to another table. That should be the usual workflow used
> in the wild - but be aware of this.

**BEFORE**

```php
use TYPO3\CMS\Core\Database\Connection as Typo3Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/** @var Typo3Connection $connection */
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
    ->getConnectionForTable('tx_myextension_mytable');

$connection->insert(
    'tx_myextension_mytable',
    [
        'pid' => $pid,
        'some_string' => $someString,
    ],
    [
        \PDO::PARAM_INT,
        \PDO::PARAM_STR,
    ]
);
$uid = $connection->lastInsertId('tx_myextension_mytable');
```

**AFTER**

```php
use TYPO3\CMS\Core\Database\Connection as Typo3Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/** @var Typo3Connection $connection */
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
    ->getConnectionForTable('tx_myextension_mytable');

$connection->insert(
    'tx_myextension_mytable',
    [
        'pid' => $pid,
        'some_string' => $someString,
    ],
    [
        Typo3Connection::PARAM_INT,
        Typo3Connection::PARAM_STR,
    ]
);
$uid = $connection->lastInsertId();
```
