Ver Fonte

Fixed persistAs*SiblingOf methods. Previously sibling's been used as parent, what hasn't been valid.

Daniel Bojdo há 13 anos atrás
pai
commit
4472576c7d

+ 2 - 0
lib/Gedmo/Tree/Entity/Repository/NestedTreeRepository.php

@@ -94,6 +94,8 @@ class NestedTreeRepository extends AbstractTreeRepository
                     throw new \Gedmo\Exception\InvalidArgumentException('If "Of" is specified you must provide parent or sibling as the second argument');
                 }
                 $parent = $args[1];
+    			$parent = substr($method,-7) == 'ChildOf' ? $parent : $parent->getParent();
+                
                 $wrapped->setPropertyValue($config['parent'], $parent);
                 $position = substr($position, 0, -2);
             }