Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 5e6fe66

Browse files
committed
Added a step for the creation of /cms/routes in the LoadRoutingData fixture.
Without it, the doctrine:phpcr:fixtures:load command crash with an InvalidArgumentException error : "Parent must be an object NULL given." This step is present in the book/routing.rst chapter.
1 parent c667ab3 commit 5e6fe66

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

quick_tour/the_router.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Now you can add a new ``Route`` to the tree using Doctrine::
151151

152152
use Doctrine\Common\Persistence\ObjectManager;
153153
use Doctrine\Common\DataFixtures\FixtureInterface;
154+
155+
use PHPCR\Util\NodeHelper;
154156

155157
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
156158

@@ -162,6 +164,9 @@ Now you can add a new ``Route`` to the tree using Doctrine::
162164
$class = get_class($documentManager);
163165
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
164166
}
167+
168+
$session = $documentManager->getPhpcrSession();
169+
NodeHelper::createPath($session, '/cms/routes');
165170

166171
$routesRoot = $documentManager->find(null, '/cms/routes');
167172

0 commit comments

Comments
 (0)