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

[WCM] Update docs to use get/setParentDocument instead of get/setParent. #491

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bundles/menu/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ each of which specifies a URI::
$menu = new Menu();
$menu->setName('main-menu');
$menu->setLabel('Main Menu');
$menu->setParent($menuParent);
$menu->setParentDocument($menuParent);

$manager->persist($menu);

$home = new MenuNode();
$home->setName('home');
$home->setLabel('Home');
$home->setParent($menu);
$home->setParentDocument($menu);
$home->setUri('http://www.example.com/home');

$manager->persist($home);

$contact = new MenuNode();
$contact->setName('contact');
$contact->setLabel('Contact');
$contact->setParent($menu);
$contact->setParentDocument($menu);
$contact->setUri('http://www.example.com/contact');

$manager->persist($contact);
Expand Down
6 changes: 3 additions & 3 deletions bundles/menu/menu_documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ the KnpMenu component documentation for more information.

.. code-block:: php

use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNodeBase;
use Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode;

$parent = ...;

// ODM specific
$node = new MenuNodeBase();
$node->setParent($parent);
$node = new MenuNode();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the title of the section is wrong ;-)

i re-copy my comment that is now hidden by github: i would combine this section with the one below and only talk about the MenuNode and not about MenuNodeBase (that class is basically to extend in other classes).

you could convert the intro talking about base things to a sidebar or .. note:: and just explain how to use the MenuNode.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should remove the *Base document documentation. It's essential to know that the CMF does not require any third party lib

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbu @wouterj This doc PR will have to wait until symfony-cmf/menu-bundle#190 is resolved (hopefully this can all happen today)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wouterj i just am afraid that this will lead to confusion for the users. but if we go that way, this section should only explain how to set the label and such things that are in the Model class. and then the next section explains how to persist a doctrine menu node.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony-cmf/menu-bundle#191 has been merged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbu well, let's leave it now and see how we do that after 1.1 stable :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay but lets open an issue so we don't forget.

$node->setParentDocument($parent);
$node->setName('home');

// Attributes are the HTML attributes of the DOM element representing the
Expand Down