Skip to content

Commit bd28cb1

Browse files
committed
DDC-645 - Demoted <change-tracking-policy /> to an attribute on <entity /> to allow better validation, fixed XSD schema
1 parent 251247c commit bd28cb1

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

UPGRADE_TO_2_0

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Update from 2.0-BETA3 to 2.0-BETA4
2+
3+
## XML Driver <change-tracking-policy /> element demoted to attribute
4+
5+
We changed how the XML Driver allows to define the change-tracking-policy. The working case is now:
6+
7+
<entity change-tracking-policy="DEFERRED_IMPLICT" />
8+
19
# Update from 2.0-BETA2 to 2.0-BETA3
210

311
## Serialization of Uninitialized Proxies

doctrine-mapping.xsd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,22 @@
7575
<xs:attribute name="schema" type="xs:NMTOKEN" />
7676
<xs:attribute name="repository-class" type="xs:NMTOKEN"/>
7777
<xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
78+
<xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
7879
</xs:complexType>
7980

8081
<xs:complexType name="mapped-superclass" >
8182
<xs:complexContent>
8283
<xs:extension base="orm:entity"/>
8384
</xs:complexContent>
8485
</xs:complexType>
86+
87+
<xs:simpleType name="change-tracking-policy">
88+
<xs:restriction base="xs:token">
89+
<xs:enumeration value="DEFERRED_IMPLICIT"/>
90+
<xs:enumeration value="DEFERRED_EXPLICIT"/>
91+
<xs:enumeration value="NOTIFY"/>
92+
</xs:restriction>
93+
</xs:simpleType>
8594

8695
<xs:simpleType name="inheritance-type">
8796
<xs:restriction base="xs:token">

lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
9999
}
100100

101101
// Evaluate <change-tracking-policy...>
102-
if (isset($xmlRoot->{'change-tracking-policy'})) {
102+
if (isset($xmlRoot['change-tracking-policy'])) {
103103
$metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'
104-
. strtoupper((string)$xmlRoot->{'change-tracking-policy'})));
104+
. strtoupper((string)$xmlRoot['change-tracking-policy'])));
105105
}
106106

107107
// Evaluate <indexes...>

0 commit comments

Comments
 (0)