Add support for EntityManager::remove() of full or partial association primary keys
This commit is contained in:
parent
10f47389ae
commit
013262a9b7
@ -687,8 +687,12 @@ class ClassMetadataInfo
|
||||
if ($this->isIdentifierComposite) {
|
||||
$columnNames = array();
|
||||
foreach ($this->identifier as $idField) {
|
||||
if (isset($this->associationMappings[$idField])) {
|
||||
$columnNames[] = $this->associationMappings[$idField]->joinColumns[0]['name'];
|
||||
} else {
|
||||
$columnNames[] = $this->fieldMappings[$idField]['columnName'];
|
||||
}
|
||||
}
|
||||
return $columnNames;
|
||||
} else {
|
||||
return array($this->fieldMappings[$this->identifier[0]]['columnName']);
|
||||
|
@ -55,6 +55,9 @@ class DDC117Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->assertType(__NAMESPACE__."\DDC117Article", $refRep->source());
|
||||
|
||||
$this->assertSame($refRep, $this->_em->find(__NAMESPACE__."\DDC117Reference", array('source' => 1, 'target' => 2)));
|
||||
|
||||
$this->_em->remove($refRep);
|
||||
$this->_em->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user