Permalink
Browse files

[DDC-561] Fixed.

  • Loading branch information...
1 parent 47ebbb4 commit db2be55e27c87fa513073b2bf44456f1d1423582 @romanb romanb committed Apr 30, 2010
@@ -356,7 +356,8 @@ public function __sleep()
$serialized = array(
'sourceEntityName',
'targetEntityName',
- 'sourceFieldName'
+ 'sourceFieldName',
+ 'fetchMode'
);
if ($this->isCascadeDetach) {
@@ -286,6 +286,7 @@ public function __sleep()
'identifier',
'isIdentifierComposite', // TODO: REMOVE
'name',
+ 'namespace', // TODO: REMOVE
'table',
'rootEntityName',
'idGenerator', //TODO: Does not really need to be serialized. Could be moved to runtime.
@@ -143,7 +143,7 @@ public function loadMetadataForClass($className, ClassMetadataInfo $metadata)
throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className);
}
- // Evaluate DoctrineTable annotation
+ // Evaluate Table annotation
if (isset($classAnnotations['Doctrine\ORM\Mapping\Table'])) {
$tableAnnot = $classAnnotations['Doctrine\ORM\Mapping\Table'];
$primaryTable = array(
@@ -359,7 +359,7 @@ public function remove($key)
$this->_em->getUnitOfWork()->scheduleOrphanRemoval($removed);
}
}
-
+
return $removed;
}
@@ -37,6 +37,7 @@ public function testClassMetadataInstanceSerialization()
// Check state
$this->assertTrue(count($cm->getReflectionProperties()) > 0);
+ $this->assertEquals('Doctrine\Tests\Models\CMS', $cm->namespace);
$this->assertTrue($cm->reflClass instanceof \ReflectionClass);
$this->assertEquals('Doctrine\Tests\Models\CMS\CmsUser', $cm->name);
$this->assertEquals('UserParent', $cm->rootEntityName);
@@ -47,6 +48,7 @@ public function testClassMetadataInstanceSerialization()
$this->assertTrue($cm->getAssociationMapping('phonenumbers') instanceof \Doctrine\ORM\Mapping\OneToOneMapping);
$this->assertEquals(1, count($cm->associationMappings));
$oneOneMapping = $cm->getAssociationMapping('phonenumbers');
+ $this->assertTrue($oneOneMapping->fetchMode == \Doctrine\ORM\Mapping\AssociationMapping::FETCH_LAZY);
$this->assertEquals('phonenumbers', $oneOneMapping->sourceFieldName);
$this->assertEquals('Doctrine\Tests\Models\CMS\Bar', $oneOneMapping->targetEntityName);
}

0 comments on commit db2be55

Please sign in to comment.