Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Commit c17c125

Browse files
reyostallenbergniels-nijens
authored andcommitted
Add table attribute to doctrine entity mapping (#45)
1 parent 4c31a68 commit c17c125

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Resources/xsl/doctrine-mapping.xsl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<xsl:element name='entity' namespace='http://doctrine-project.org/schemas/orm/doctrine-mapping'>
3131
<xsl:attribute name='name'><xsl:value-of select='$objectNamespace'/><xsl:value-of select='@name'/></xsl:attribute>
3232
<xsl:apply-templates select='self::node()' mode='entityIdentifier'/>
33+
<xsl:apply-templates select='orm' mode='tableAttribute'/>
3334
<xsl:apply-templates select='fields/field'/>
3435
<xsl:apply-templates select='fields/field' mode='fieldEntityReference'/>
3536
</xsl:element>
@@ -64,6 +65,16 @@
6465
-->
6566
<xsl:template match='object[orm/field-defined[@name = "id"]]' mode='entityIdentifier'/>
6667

68+
<!--
69+
Add a table attribute to the entity if available.
70+
-->
71+
<xsl:template match='orm' mode='tableAttribute'/>
72+
<xsl:template match='orm[@table]' mode='tableAttribute'>
73+
<xsl:attribute name='table'>
74+
<xsl:value-of select='@table'/>
75+
</xsl:attribute>
76+
</xsl:template>
77+
6778
<!--
6879
Add a field mapping to an entity.
6980
-->

0 commit comments

Comments
 (0)