Skip to content
Snippets Groups Projects
Commit 4123c59d authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Nikita Hovratov
Browse files

[FEATURE] Introduce non-magic repository find methods

This change introduces alternative methods to magic method
__call() of extbase's Repository class. The magic method
allowed for calling findBy[Property](), findOneBy[Property]()
and countBy[Property](). Those methods are now implemented
with a slightly different method signature but with type
declaration and phpstan support.

The naming follows the one of doctrine/orm which is
implemented exactly the same.

The new methods are:

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

Using the magic methods is deprecated but will only
trigger an E_USER_DEPRECATED error as of version 13.

Releases: main
Resolves: #100071
Change-Id: I1b51dd5b583a225a8a4d6f948810b1e5ef5d2257
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78014


Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed...
parent ea417016
Branches
Tags
No related merge requests found
Showing with 738 additions and 122 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment