---
title: "Feature: #100071 - Introduce non-magic repository find methods"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-100071-1677853567"
source: "Changelog/12.3/Feature-100071-IntroduceNon-magicRepositoryFindMethods.rst"
typo3-version: "12.3"
typo3-major: 12
type: "feature"
issue: 100071
forge: "https://forge.typo3.org/issues/100071"
tags: ["PHP-API", "NotScanned", "ext:extbase"]
rendered: "2026-10-02T15:05:01+00:00"
---

# Feature: #100071 - Introduce non-magic repository find methods {#feature-100071-1677853567}

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:

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

Magic methods are quite handy but they have a huge disadvantage. There is no
proper IDE support i.e. most IDEs show an error or at least a warning,
saying method `findByAuthor()` does not exist. Also, type declarations are
impossible to use because with `__call()` everything is `mixed`. And
last but not least, static code analysis - like PHPStan - cannot properly
analyze those and give meaningful errors.

Therefore, there is a new set of methods without all those downsides:

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

The naming of those 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.

Example:

```php
$this->blogRepository->findBy(['author' => 1, 'published' => true]);
```

## Impact {#impact}

The new methods support a broader feature set, support IDEs, static code
analyzers and type declarations.
