Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-28

ProxyClassGenerator should not attempt to override static methods

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-ALPHA2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      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()) {

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Ismo Toijala
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: