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

Commit fa5c419

Browse files
committed
Merge pull request #496 from symfony-cmf/menu-parent-cleanup
cleanup menu parent documentation
2 parents 44ba64d + 983ac1d commit fa5c419

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bundles/menu/menu_documents.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Menu Documents
77
In accordance with the
88
:ref:`CMF bundle standards <contrib_bundles_baseandstandardimplementations>`
99
you are provided with two menu node implementations, a base document and a
10-
standard document.
10+
standard document. Both exist in the ``Model`` namespace as storage agnostic
11+
classes and in ``Doctrine\Phpcr`` with specific features for PHPCR-ODM.
1112

1213
Base Menu Node
1314
--------------
@@ -20,11 +21,11 @@ the KnpMenu component documentation for more information.
2021
2122
use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNodeBase;
2223
23-
$parent = ...;
24+
// find the menu tree root
25+
$mainMenu = $dm->find('Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu', '/cms/menu/main');
2426
25-
// ODM specific
2627
$node = new MenuNodeBase();
27-
$node->setParentDocument($parent);
28+
$mainMenu->addChild($node);
2829
$node->setName('home');
2930
3031
// Attributes are the HTML attributes of the DOM element representing the
@@ -63,6 +64,7 @@ The Standard Menu Node
6364
The standard menu node supports the following CMF specific features
6465
out-of-the-box:
6566

67+
* Methods to set and get parent document;
6668
* Content association;
6769
* Link type specification (URI, route or content);
6870
* Standard :doc:`publish workflow <../core/publish_workflow>` integration;

0 commit comments

Comments
 (0)