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

Commit 2258208

Browse files
author
Hakier
committed
Update the_router.rst
Needed to implement OrderedFixtureInterface and return higher value than LoadPageData::getOrder, otherwise will occur RuntimeException("Controller "Symfony\Cmf\Bundle\ContentBundle\Controller\ContentController::indexAction()" requires that you provide a value for the "$contentDocument" argument (because there is no default value or because there is a non optional argument after this one).") because '/cms/simple/quick_tour' will no exist yet
1 parent 7d8864e commit 2258208

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

quick_tour/the_router.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,22 @@ 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+
// refers to the order in which the class' load function is called
165+
// (lower return values are called first)
166+
// used value 20, because LoadPageData::getOrder returns 10 and LoadDemoData no implements OrderedFixtureInterface so will be called before it, otherwise will occur RuntimeException("Controller "Symfony\Cmf\Bundle\ContentBundle\Controller\ContentController::indexAction()" requires that you provide a value for the "$contentDocument" argument (because there is no default value or because there is a non optional argument after this one).") because '/cms/simple/quick_tour' will no exist yet
167+
return 20;
168+
}
169+
161170
public function load(ObjectManager $documentManager)
162171
{
163172
if (!$documentManager instanceof DocumentManager) {

0 commit comments

Comments
 (0)