mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Define custom function in custom repository #5232
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davidedonattini on GitHub (Aug 25, 2016).
Originally assigned to: @Ocramius on GitHub.
Hello,
I would like a private function in my custom repository for pagination the results but I can not because I get this error:
"Undefined method 'pagingResults'. The method name must start with either findBy or findOneBy!"
I check the Doctrine\ORM\EntityRepository and I found that the __call function force only functions which are prefixed with 'findBy' and 'findOneBy'.
Any suggestions?
This is my code in Symfony3 project:
@Ocramius commented on GitHub (Aug 25, 2016):
Must be a
publicfunction, if you want it to be available from collaborators.protectedif you use inheritance.