[PR #5639] Improve the error by showing wich object entity was being used when t… #9671

Open
opened 2026-01-22 16:05:04 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5639

State: closed
Merged: No


…he method was detected missing

I had a error that didn't show which class didn't have the method, this litle hack allowed me to have that information.
The current error shows withouth the entity to which the method is missing.
request.CRITICAL: Uncaught PHP Exception BadMethodCallException: " Undefined method 'getAll'. The method name must start with either findBy or findOneBy!" at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196 {"exception":"[object](BadMethodCallException: Undefined method 'getAll'. The method name must start with either findBy or findOneBy! at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196)"} []

This change improves the error shown:
request.CRITICAL: Uncaught PHP Exception BadMethodCallException: "In Far\MT\AccountBundle\Entity\Holder Undefined method 'getAll'. The method name must start with either findBy or findOneBy!" at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196 {"exception":"[object](BadMethodCallException: In Far\MT\AccountBundle\Entity\Holder Undefined method 'getAll'. The method name must start with either findBy or findOneBy! at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196)"} []

Now I have the Entity to which the method is missing.
(BadMethodCallException: In Far\MT\AccountBundle\Entity\Holder

**Original Pull Request:** https://github.com/doctrine/orm/pull/5639 **State:** closed **Merged:** No --- …he method was detected missing I had a error that didn't show which class didn't have the method, this litle hack allowed me to have that information. The current error shows withouth the entity to which the method is missing. request.CRITICAL: Uncaught PHP Exception BadMethodCallException: " Undefined method 'getAll'. The method name must start with either findBy or findOneBy!" at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196 {"exception":"[object](BadMethodCallException: Undefined method 'getAll'. The method name must start with either findBy or findOneBy! at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196)"} [] This change improves the error shown: request.CRITICAL: Uncaught PHP Exception BadMethodCallException: "In Far\MT\AccountBundle\Entity\Holder Undefined method 'getAll'. The method name must start with either findBy or findOneBy!" at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php line 196 {"exception":"[object](BadMethodCallException: In Far\MT\AccountBundle\Entity\Holder Undefined method 'getAll'. The method name must start with either findBy or findOneBy! at /home/andref/workspace/moneytrak/mt2/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196)"} [] Now I have the Entity to which the method is missing. (BadMethodCallException: In Far\MT\AccountBundle\Entity\Holder
admin added the pull-request label 2026-01-22 16:05:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9671