---
title: "Deprecation: #87305 - Use constructor injection in DataMapper"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-87305"
source: "Changelog/10.0/Deprecation-87305-UseConstructorInjectionInDataMapper.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Deprecation: #87305 - Use constructor injection in DataMapper

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

## Description

The 8th argument (`\TYPO3\CMS\Extbase\Persistence\QueryInterface`) of method
`\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper->__construct` has been marked as deprecated.

## Impact

Instantiating objects along with that argument will trigger a PHP `E_USER_DEPRECATED` error.

## Affected Installations

All installations that create instances of the class `\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper` while providing the 8th argument.

## Migration

Instantiate the object without the 8th argument and use `\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper->setQuery` if needed.
