Fixed bug where embedded reflection fields were never exposed to userland.
This commit is contained in:
parent
38c819ae04
commit
4680a7b861
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user