mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-28: ProxyClassGenerator should not attempt to override static methods #37
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 @doctrinebot on GitHub (Oct 1, 2009).
Jira issue originally created by user itoijala:
ProxyClassGenerator overrides all of the methods of the entity class. This includes static methods. If the entity class has a static method, an error occurs:
Fatal error: Cannot make static method Model\User\User::getCurrentUser() non static in class Doctrine\Generated\Proxies\Model_User_UserAProxy in C:\Windows\Temp\Model_User_UserAProxy.g.php on line 200
ProxyClassGenerator should ignore static methods. They do not need to be overriden, since they do not require the entity to be loaded.
A simple fix is to change the line 143 from:
if ($method->isPublic() && ! $method->isFinal()) {
to:
if ($method->isPublic() && ! $method->isFinal() && !$method->isStatic()) {
@doctrinebot commented on GitHub (Oct 3, 2009):
Issue was closed with resolution "Fixed"