---
title: "Deprecation: #100071 - Magic repository findBy() methods"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-100071-1677853787"
source: "Changelog/12.3/Deprecation-100071-MagicRepositoryFindByMethods.rst"
typo3-version: "12.3"
typo3-major: 12
type: "deprecation"
issue: 100071
forge: "https://forge.typo3.org/issues/100071"
tags: ["PHP-API", "NotScanned", "ext:extbase"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Deprecation: #100071 - Magic repository findBy() methods {#deprecation-100071-1677853787}

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

## Description {#description}

Extbase repositories come with a magic `__call()` method to allow calling
the following methods without implementing them:

-   `findBy[PropertyName]($propertyValue)`
-   `findOneBy[PropertyName]($propertyValue)`
-   `countBy[PropertyName]($propertyValue)`

These have now been marked as deprecated, as they are "magic", meaning
that proper IDE support is not possible, and other PHP-related tool
functionality such as PhpStorm.

In addition, it is not possible for Extbase repositories
to build their own magic method functionality as the logic is already
in use.

## Impact {#impact}

As these methods are widely used in almost all Extbase-based extensions,
they are marked as deprecated in TYPO3 v12, but will only trigger a deprecation
notice in TYPO3 v13, as they will be removed in TYPO3 v14.

This way, migration towards the new API methods can be made without
pressure.

## Affected installations {#affected-installations}

All installations with third-party extensions that use those magic methods.

## Migration {#migration}

A new set of methods without all the downsides have been added:

-   `findBy(array $criteria, ...): QueryResultInterface`
-   `findOneBy(array $criteria, ...):object|null`
-   `count(array $criteria, ...): int`

The naming of the methods follows those of `doctrine/orm` and only
`count()` differs from the formerly `countBy()`. While all magic
methods only allow for a single comparison (`propertyName` = `propertyValue`),
those methods allow for multiple comparisons, called constraints.

`findBy[PropertyName]($propertyValue)` can be replaced with a call to `findBy`:

```php
$this->blogRepository->findBy(['propertyName' => $propertyValue]);
```

`findOneBy[PropertyName]($propertyValue)` can be replaced with a call to `findOneBy`:

```php
$this->blogRepository->findOneBy(['propertyName' => $propertyValue]);
```

`countBy[PropertyName]($propertyValue)` can be replaced with a call to `count`:

```php
$this->blogRepository->count(['propertyName' => $propertyValue]);
```

> [!WARNING]
> **Attention**
>
> Please note that the (not-magic) methods `findByUid()` and `findByIdentifier()` did **not**
> get deprecated or removed, and are still valid to be used.
> Using these methods will fetch a given domain object by it's UID, ignoring possible storage
> page settings - unlike `findBy([...])`, which does respect those settings.
