Review main Merged

78014[FEATURE] Introduce non-magic repository find methods

Alexander Schnitzler CR +2 V +2 Hard +738 −122 updated 03/07/23, 13:34

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 9