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

Commit 43152de

Browse files
committed
Update the_model.rst
When installing via composer as per the documentation, the example does not work with phpcr-odm 1.0. It is necessary to add use Doctrine\Common\DataFixtures\OrderedFixtureInterface;, implement both the FixtureInterface and OrderedFixtureInterface classes and specify a getOrder function with a value larger than that in LoadSimpleCmsData.php, otherwise the following error message is thrown when running php app/console running doctrine:phpcr:fixtures:load: Property "parent" mapped as ParentDocument may not be empty in document of class "Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page"
1 parent 3e29d0b commit 43152de

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

quick_tour/the_model.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,17 @@ by creating a new class in the AcmeMainBundle::
9292

9393
use Doctrine\Common\Persistence\ObjectManager;
9494
use Doctrine\Common\DataFixtures\FixtureInterface;
95+
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
9596

96-
class LoadPageData implements FixtureInterface
97+
class LoadPageData implements FixtureInterface, OrderedFixtureInterface
9798
{
99+
public function getOrder()
100+
{
101+
// refers to the order in which the class' load function is called
102+
// (lower return values are called first)
103+
return 10;
104+
}
105+
98106
public function load(ObjectManager $documentManager)
99107
{
100108
}

0 commit comments

Comments
 (0)