Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1771

CLI generation of proxies for abstract STI base classes

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-RC1
    • Fix Version/s: 2.2.2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When I use the CLI tool to generate proxies manually (orm:generate-proxies), a proxy is generated for the abstract entity below, but this proxy is not declared abstract itself. The entity contains abstract methods, and the proxy obviously does not implement these methods, so it, too, must be declared abstract. Because it is not, the next time I try to generate proxies in this manner, I receive a PHP Fatal error:

      Class Proxies_CG_\Ranking\AbstractRule contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Ranking\AbstractRule::myAbstractMethod)

      My workaround is to delete this proxy first and then regenerate. While a minor inconvenience at this point, it would be great if the proxy generation code could mark proxies as abstract when necessary to avoid these errors.

      Thank you.

      – Entity

      /**

      • @Entity
      • @InheritanceType("SINGLE_TABLE")
      • @DiscriminatorColumn(name="ranking_rule_type_id", type="integer")
      • @DiscriminatorMap( { * 1 = "ConcreteRuleOne", * 2 = "ConcreteRuleTwo", * 3 = "ConcreteRuleThree" * }

        )

      • @Table(name="ranking_rules")
        */
        abstract class AbstractRule
        {

      – Generated proxy

      /**

      • THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
        */
        class AbstractRule extends \Ranking\AbstractRule implements \Doctrine\ORM\Proxy\Proxy
        {

        Activity

        breathe Brent created issue -
        Hide
        beberlei Benjamin Eberlei added a comment -

        Fixed

        Show
        beberlei Benjamin Eberlei added a comment - Fixed
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2.2 [ 10195 ]
        Resolution Fixed [ 1 ]
        Hide
        breathe Brent added a comment -

        Thank you, sir.

        Show
        breathe Brent added a comment - Thank you, sir.
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 13617 ] jira-feedback [ 15317 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15317 ] jira-feedback2 [ 17181 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17181 ] jira-feedback3 [ 19435 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={expand=changesets[0:20].revisions[0:29],reviews, query=DDC-1771}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            breathe Brent
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: