Skip to content

Commit 20b5974

Browse files
committed
[Tree - Closure] Column name is used instead of field name
1 parent 585bddb commit 20b5974

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/Gedmo/Tree/Strategy/ORM/Closure.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,6 @@ public function processPostPersist($em, $entity, AdapterInterface $ea)
255255
$descendantColumnName = $this->getJoinColumnFieldName($em->getClassMetadata($config['closure'])->getAssociationMapping('descendant'));
256256
$depthColumnName = $em->getClassMetadata($config['closure'])->getColumnName('depth');
257257

258-
$referenceMapping = $em->getClassMetadata($config['closure'])->getAssociationMapping('ancestor');
259-
$referenceId = $referenceMapping['sourceToTargetKeyColumns'][$ancestorColumnName];
260-
261258
$entries = array(
262259
array(
263260
$ancestorColumnName => $nodeId,
@@ -276,7 +273,7 @@ public function processPostPersist($em, $entity, AdapterInterface $ea)
276273

277274
foreach ($ancestors as $ancestor) {
278275
$entries[] = array(
279-
$ancestorColumnName => $ancestor['ancestor'][$referenceId],
276+
$ancestorColumnName => $ancestor['ancestor'][$identifier],
280277
$descendantColumnName => $nodeId,
281278
$depthColumnName => $ancestor['depth'] + 1,
282279
);

0 commit comments

Comments
 (0)