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

Commit a7c5173

Browse files
committed
Fix missing namespace usage
1 parent a77877c commit a7c5173

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tutorial/getting-started.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ Create a page for your CMS::
364364
use Acme\BasicCmsBundle\Document\Page;
365365
use Doctrine\Common\DataFixtures\FixtureInterface;
366366
use Doctrine\Common\Persistence\ObjectManager;
367+
use Doctrine\ODM\PHPCR\DocumentManager;
367368

368369
class LoadPageData implements FixtureInterface
369370
{
@@ -396,12 +397,18 @@ and add some posts::
396397

397398
use Doctrine\Common\DataFixtures\FixtureInterface;
398399
use Doctrine\Common\Persistence\ObjectManager;
400+
use Doctrine\ODM\PHPCR\DocumentManager;
399401
use Acme\BasicCmsBundle\Document\Post;
400402

401403
class LoadPostData implements FixtureInterface
402404
{
403405
public function load(ObjectManager $dm)
404406
{
407+
if (!$dm instanceof DocumentManager) {
408+
$class = get_class($dm);
409+
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
410+
}
411+
405412
$parent = $dm->find(null, '/cms/posts');
406413

407414
foreach (array('First', 'Second', 'Third', 'Forth') as $title) {

0 commit comments

Comments
 (0)