From 983ac1dc85ace64cce48a7ac89450b2434ddcc9d Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Tue, 20 May 2014 21:28:18 +0200 Subject: [PATCH] cleanup menu parent documentation --- bundles/menu/menu_documents.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bundles/menu/menu_documents.rst b/bundles/menu/menu_documents.rst index f683d0c5..feab51da 100644 --- a/bundles/menu/menu_documents.rst +++ b/bundles/menu/menu_documents.rst @@ -7,7 +7,8 @@ Menu Documents In accordance with the :ref:`CMF bundle standards ` you are provided with two menu node implementations, a base document and a -standard document. +standard document. Both exist in the ``Model`` namespace as storage agnostic +classes and in ``Doctrine\Phpcr`` with specific features for PHPCR-ODM. Base Menu Node -------------- @@ -20,11 +21,11 @@ the KnpMenu component documentation for more information. use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNodeBase; - $parent = ...; + // find the menu tree root + $mainMenu = $dm->find('Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu', '/cms/menu/main'); - // ODM specific $node = new MenuNodeBase(); - $node->setParentDocument($parent); + $mainMenu->addChild($node); $node->setName('home'); // Attributes are the HTML attributes of the DOM element representing the @@ -63,6 +64,7 @@ The Standard Menu Node The standard menu node supports the following CMF specific features out-of-the-box: +* Methods to set and get parent document; * Content association; * Link type specification (URI, route or content); * Standard :doc:`publish workflow <../core/publish_workflow>` integration;