[DDC-1771] CLI generation of proxies for abstract STI base classes Created: 05/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.0-RC1
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Minor
Reporter: Brent Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
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
    {


 Comments   
Comment by Benjamin Eberlei [ 07/Apr/12 ]

Fixed

Comment by Brent [ 07/Apr/12 ]

Thank you, sir.

Generated at Thu Oct 02 02:51:22 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.