This repository was archived by the owner on Jul 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696 <xsl : apply-templates select =' self::node()' mode =' fieldLengthAttribute' />
9797 <xsl : apply-templates select =' self::node()' mode =' fieldUniqueAttribute' />
9898 <xsl : apply-templates select =' self::node()' mode =' fieldScalePrecisionAttribute' />
99+ <xsl : apply-templates select =' self::node()' mode =' fieldOptions' />
99100 </xsl : element >
100101 </xsl : template >
101102
187188 <xsl : attribute name =' precision' ><xsl : value-of select =' @precision' /></xsl : attribute >
188189 </xsl : template >
189190
191+ <!--
192+ Don't add options by default.
193+ -->
194+ <xsl : template match =' object/fields/field' mode =' fieldOptions' />
195+
196+ <!--
197+ Add options when default_value is set.
198+ -->
199+ <xsl : template match =' object/fields/field[@default_value]' mode =' fieldOptions' >
200+ <xsl : element name =' options' namespace =' http://doctrine-project.org/schemas/orm/doctrine-mapping' >
201+ <xsl : apply-templates select =' self::node()[@default_value]' mode =' fieldOptionDefault' />
202+ </xsl : element >
203+ </xsl : template >
204+
205+ <!--
206+ Add option for default.
207+ -->
208+ <xsl : template match =' object/fields/field[@default_value]' mode =' fieldOptionDefault' >
209+ <xsl : element name =' option' namespace =' http://doctrine-project.org/schemas/orm/doctrine-mapping' >
210+ <xsl : attribute name =' name' >default</xsl : attribute >
211+ <xsl : value-of select =' @default_value' />
212+ </xsl : element >
213+ </xsl : template >
214+
190215 <!--
191216 Don't add a field mapping when a field is defined in a orm/field-defined node or are an object reference.
192217 -->
You can’t perform that action at this time.
0 commit comments