Permalink
Browse files

DDC-645 - Demoted <change-tracking-policy /> to an attribute on <enti…

…ty /> to allow better validation, fixed XSD schema
  • Loading branch information...
beberlei committed Aug 8, 2010
1 parent 251247c commit bd28cb1b12faaa9106126e49f45b8f6d61c927ae
Showing with 19 additions and 2 deletions.
  1. +8 −0 UPGRADE_TO_2_0
  2. +9 −0 doctrine-mapping.xsd
  3. +2 −2 lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php
View
@@ -1,3 +1,11 @@
# Update from 2.0-BETA3 to 2.0-BETA4
## XML Driver <change-tracking-policy /> element demoted to attribute
We changed how the XML Driver allows to define the change-tracking-policy. The working case is now:
<entity change-tracking-policy="DEFERRED_IMPLICT" />
# Update from 2.0-BETA2 to 2.0-BETA3
## Serialization of Uninitialized Proxies
View
@@ -75,13 +75,22 @@
<xs:attribute name="schema" type="xs:NMTOKEN" />
<xs:attribute name="repository-class" type="xs:NMTOKEN"/>
<xs:attribute name="inheritance-type" type="orm:inheritance-type"/>
<xs:attribute name="change-tracking-policy" type="orm:change-tracking-policy" />
</xs:complexType>
<xs:complexType name="mapped-superclass" >
<xs:complexContent>
<xs:extension base="orm:entity"/>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="change-tracking-policy">
<xs:restriction base="xs:token">
<xs:enumeration value="DEFERRED_IMPLICIT"/>
<xs:enumeration value="DEFERRED_EXPLICIT"/>
<xs:enumeration value="NOTIFY"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="inheritance-type">
<xs:restriction base="xs:token">
@@ -99,9 +99,9 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
}
// Evaluate <change-tracking-policy...>
if (isset($xmlRoot->{'change-tracking-policy'})) {
if (isset($xmlRoot['change-tracking-policy'])) {
$metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_'
. strtoupper((string)$xmlRoot->{'change-tracking-policy'})));
. strtoupper((string)$xmlRoot['change-tracking-policy'])));
}
// Evaluate <indexes...>

0 comments on commit bd28cb1

Please sign in to comment.