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

Commit d94acda

Browse files
committed
Merge pull request #712 from Hakier/patch-1
Update the_router.rst
2 parents 7d8864e + 93358dc commit d94acda

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

quick_tour/the_router.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,19 @@ 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+
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
154155
155156
use PHPCR\Util\NodeHelper;
156157

157158
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
158159

159-
class LoadRoutingData implements FixtureInterface
160+
class LoadRoutingData implements FixtureInterface, OrderedFixtureInterface
160161
{
162+
public function getOrder()
163+
{
164+
return 20;
165+
}
166+
161167
public function load(ObjectManager $documentManager)
162168
{
163169
if (!$documentManager instanceof DocumentManager) {
@@ -184,6 +190,8 @@ Now you can add a new ``Route`` to the tree using Doctrine::
184190
$documentManager->flush(); // save it
185191
}
186192
}
193+
194+
Above we implemented the ``OrderedFixtureInterface`` so that our routes were loaded in the correct sequence relative to other fixtures.
187195

188196
This creates a new node called ``/cms/routes/new-route``, which will display
189197
our ``quick_tour`` page when you go to ``/new-route``.

0 commit comments

Comments
 (0)