This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,19 @@ Now you can add a new ``Route`` to the tree using Doctrine::
151
151
152
152
use Doctrine\Common\Persistence\ObjectManager;
153
153
use Doctrine\Common\DataFixtures\FixtureInterface;
154
+ use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
154
155
155
156
use PHPCR\Util\NodeHelper;
156
157
157
158
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
158
159
159
- class LoadRoutingData implements FixtureInterface
160
+ class LoadRoutingData implements FixtureInterface, OrderedFixtureInterface
160
161
{
162
+ public function getOrder()
163
+ {
164
+ return 20;
165
+ }
166
+
161
167
public function load(ObjectManager $documentManager)
162
168
{
163
169
if (!$documentManager instanceof DocumentManager) {
@@ -184,6 +190,8 @@ Now you can add a new ``Route`` to the tree using Doctrine::
184
190
$documentManager->flush(); // save it
185
191
}
186
192
}
193
+
194
+ Above we implemented the ``OrderedFixtureInterface `` so that our routes were loaded in the correct sequence relative to other fixtures.
187
195
188
196
This creates a new node called ``/cms/routes/new-route ``, which will display
189
197
our ``quick_tour `` page when you go to ``/new-route ``.
You can’t perform that action at this time.
0 commit comments