I spent a while thinking about the best way to do this, and ended up
doing it this way despite the fact that it is evil.

Will have another look.

On Mon, Oct 28, 2013 at 12:12:49AM -0700, David Buchmann wrote:
>    In cookbook/creating_basic_cms.rst:
> 
>  > +    use PHPCR\Util\NodeHelper;
>  > +
>  > +    class SiteInitializer implements InitializerInterface
>  > +    {
>  > +        public function init(SessionInterface $session)
>  > +        {
>  > +            // create the 'cms', 'pages', and 'posts' nodes
>  > +            NodeHelper::createPath($session, '/cms/pages');
>  > +            NodeHelper::createPath($session, '/cms/posts');
>  > +            NodeHelper::createPath($session, '/cms/routes');
>  > +            $session->save();
>  > +
>  > +            // map a document to the 'cms' node
>  > +            $cms = $session->getNode('/cms');
>  > +            $cms->setProperty(
>  > +                'phpcr:class',  'Acme\BasicCmsBundle\Document\Site'
> 
>    i would prefer to inject the dm into this initializer and use phpcr-odm to
>    create documents. that needs a lot less inside knowledge.
> 
>    —
>    Reply to this email directly or [1]view it on GitHub.
> 
> References
> 
>    Visible links
>    1. https://github.com/symfony-cmf/symfony-cmf-docs/pull/303/files#r7241158