Skip to content

Commit a6ff502

Browse files
committed
fix nested set issue in php7 (see https://3v4l.org/IARp7)
1 parent 24cd861 commit a6ff502

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ public function shiftRL(EntityManager $em, $class, $first, $delta, $root = null)
533533
if ($node instanceof Proxy && !$node->__isInitialized__) {
534534
continue;
535535
}
536+
if (get_class($node) !== $class) {
537+
continue;
538+
}
536539
$oid = spl_object_hash($node);
537540
$left = $meta->getReflectionProperty($config['left'])->getValue($node);
538541
$currentRoot = isset($config['root']) ? $meta->getReflectionProperty($config['root'])->getValue($node) : null;
@@ -599,6 +602,9 @@ public function shiftRangeRL(EntityManager $em, $class, $first, $last, $delta, $
599602
if ($node instanceof Proxy && !$node->__isInitialized__) {
600603
continue;
601604
}
605+
if (get_class($node) !== $class) {
606+
continue;
607+
}
602608
$left = $meta->getReflectionProperty($config['left'])->getValue($node);
603609
$right = $meta->getReflectionProperty($config['right'])->getValue($node);
604610
$currentRoot = isset($config['root']) ? $meta->getReflectionProperty($config['root'])->getValue($node) : null;

0 commit comments

Comments
 (0)