To improve possible reuse of Domain Entities and inspired by this article 
(http://docs.doctrine-project.org/en/latest/cookbook/resolve-target-entity-listener.html),
 
I am currently looking at separating mapping information from my Entities, 
by using XML-mapping files instead of in-line annotations.

To prevent coding the XML-mapping by hand, I used: 
php doctrine.php orm:convert-mapping --force xml xml/orm-mapping

This worked quite nice and resulted in an XML-mapping file for each Entity. 
However, it seems that inherited Entity properties are also defined twice. 

class A{
    /**
     * @ORM\Column
     */
    protected $a;
}
class B extends A{
    /**
     * @ORM\Column
     */
    protected $b;
}

Results in two files:
<doctrine-mapping>
  <entity name="A">
    <field name="a" type="string" column="a" />
  </entity>
</doctrine-mapping

<doctrine-mapping>
  <entity name="B">
    <field name="a" type="string" column="a" />
    <field name="b" type="string" column="b" />
  </entity>
</doctrine-mapping


   - Using a MappedSuperclass (which would mark the property / association 
   as 'inherited' in the Metadata) is not an option, since the inheritance 
   hierarchy is quite large.
   - Manually removing of the duplicate properties is an option, but not 
   preferred ;)


My question: is there way to prevent 'inherited' fields from being included 
when generating the XML-mapping from the annotations?

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to