diff --git a/Adapter/PhpcrOdmAdapter.php b/Adapter/PhpcrOdmAdapter.php index 58b55b8..6a9c54e 100644 --- a/Adapter/PhpcrOdmAdapter.php +++ b/Adapter/PhpcrOdmAdapter.php @@ -127,7 +127,7 @@ public function createAutoRoute($uri, $contentDocument, $autoRouteTag) if (null === $document) { $document = new Generic(); - $document->setParent($parentDocument); + $document->setParentDocument($parentDocument); $document->setNodeName($segment); $this->dm->persist($document); } @@ -160,7 +160,7 @@ public function createAutoRoute($uri, $contentDocument, $autoRouteTag) $headRoute = new $this->autoRouteFqcn(); $headRoute->setContent($contentDocument); $headRoute->setName($headName); - $headRoute->setParent($document); + $headRoute->setParentDocument($document); $headRoute->setAutoRouteTag($autoRouteTag); $headRoute->setType(AutoRouteInterface::TYPE_PRIMARY); diff --git a/Tests/Functional/EventListener/AutoRouteListenerTest.php b/Tests/Functional/EventListener/AutoRouteListenerTest.php index c5e3ff8..5bd470e 100644 --- a/Tests/Functional/EventListener/AutoRouteListenerTest.php +++ b/Tests/Functional/EventListener/AutoRouteListenerTest.php @@ -445,7 +445,7 @@ public function testLeaveRedirectChildrenMigrations() $parentRoute = $this->getDm()->find(null, '/test/auto-route/seo-articles/hai'); $childRoute = new AutoRoute(); $childRoute->setName('foo'); - $childRoute->setParent($parentRoute); + $childRoute->setParentDocument($parentRoute); $this->getDm()->persist($childRoute); $this->getDm()->flush(); @@ -476,7 +476,7 @@ public function testMaintainRedirectParentPath() $parentRoute = $this->getDm()->find(null, '/test/auto-route'); $autoRoute = $this->getDm()->find(null, '/test/auto-route/seo-articles/hai'); - $autoRoute->setParent($parentRoute); + $autoRoute->setParentDocument($parentRoute); $this->getDm()->persist($autoRoute); $this->getDm()->flush(); diff --git a/Tests/Unit/Adapter/PhpcrOdmAdapterTest.php b/Tests/Unit/Adapter/PhpcrOdmAdapterTest.php index 83184f3..66163b0 100644 --- a/Tests/Unit/Adapter/PhpcrOdmAdapterTest.php +++ b/Tests/Unit/Adapter/PhpcrOdmAdapterTest.php @@ -121,7 +121,7 @@ public function testCreateAutoRoute($path, $expectedParentPath, $expectedName, $ $this->assertInstanceOf('Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute', $res); $this->assertEquals($expectedName, $res->getName()); - $this->assertSame($this->parentRoute, $res->getParent()); + $this->assertSame($this->parentRoute, $res->getParentDocument()); $this->assertSame($this->contentDocument, $res->getContent()); }