[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:Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Nikita Hovratov <nikita.h@live.de> Reviewed...
Showing
- Build/phpstan/phpstan-baseline.neon 26 additions, 26 deletionsBuild/phpstan/phpstan-baseline.neon
- typo3/sysext/core/Documentation/Changelog/12.3/Deprecation-100071-MagicRepositoryFindByMethods.rst 82 additions, 0 deletions.../12.3/Deprecation-100071-MagicRepositoryFindByMethods.rst
- typo3/sysext/core/Documentation/Changelog/12.3/Feature-100071-IntroduceNon-magicRepositoryFindMethods.rst 51 additions, 0 deletions...eature-100071-IntroduceNon-magicRepositoryFindMethods.rst
- typo3/sysext/extbase/Classes/Persistence/Repository.php 72 additions, 0 deletionstypo3/sysext/extbase/Classes/Persistence/Repository.php
- typo3/sysext/extbase/Tests/Functional/Persistence/RepositoryTest.php 308 additions, 0 deletions...t/extbase/Tests/Functional/Persistence/RepositoryTest.php
- typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php 0 additions, 91 deletions.../sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php
- typo3/sysext/extbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php 194 additions, 0 deletions...tbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php
- typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php 1 addition, 1 deletion...xt/extensionmanager/Classes/Utility/DependencyUtility.php
- typo3/sysext/extensionmanager/Tests/Unit/Utility/DependencyUtilityTest.php 4 additions, 4 deletions...nsionmanager/Tests/Unit/Utility/DependencyUtilityTest.php
Please register or sign in to comment