1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Fixed bug where embedded reflection fields were never exposed to userland.

This commit is contained in:
Guilherme Blanco 2015-02-20 14:10:28 -05:00
parent 38c819ae04
commit 4680a7b861
3 changed files with 17 additions and 1 deletions

View File

@ -941,6 +941,7 @@ class ClassMetadataInfo implements ClassMetadata
}
$parentReflFields[$property] = $reflService->getAccessibleProperty($this->name, $property);
$this->reflFields[$property] = $reflService->getAccessibleProperty($this->name, $property);
}
foreach ($this->fieldMappings as $field => $mapping) {

View File

@ -613,10 +613,13 @@ class BasicEntityPersister implements EntityPersister
continue;
}
if (isset($this->class->embeddedClasses[$field])) {
continue;
}
$newVal = $change[1];
if ( ! isset($this->class->associationMappings[$field])) {
$columnName = $this->class->columnNames[$field];
$this->columnTypes[$columnName] = $this->class->fieldMappings[$field]['type'];
$result[$this->getOwningTable($field)][$columnName] = $newVal;
@ -1420,6 +1423,10 @@ class BasicEntityPersister implements EntityPersister
continue;
}
if (isset($this->class->embeddedClasses[$name])) {
continue;
}
if (isset($this->class->associationMappings[$name])) {
$assoc = $this->class->associationMappings[$name];
if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) {

View File

@ -24,6 +24,14 @@ class ValueObjectsTest extends \Doctrine\Tests\OrmFunctionalTestCase
}
}
public function testMetadataHasReflectionEmbeddablesAccessible()
{
$classMetadata = $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC93Person');
$this->assertInstanceOf('Doctrine\Common\Reflection\RuntimePublicReflectionProperty', $classMetadata->getReflectionProperty('address'));
$this->assertInstanceOf('Doctrine\ORM\Mapping\ReflectionEmbeddedProperty', $classMetadata->getReflectionProperty('address.street'));
}
public function testCRUD()
{
$person = new DDC93Person();