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

Commit 76c673d

Browse files
committed
Merge pull request #374 from symfony-cmf/menu-prefetch
document the menu prefetch option
2 parents 11f5499 + 924b286 commit 76c673d

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

reference/configuration/menu.rst

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ persistence configuration has the following configuration:
2727
enabled: false
2828
menu_basepath: /cms/menu
2929
content_basepath: ~
30+
prefetch: 10
3031
manager_name: ~
3132
menu_document_class: Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu
3233
node_document_class: Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode
@@ -46,6 +47,7 @@ persistence configuration has the following configuration:
4647
enabled="false"
4748
menu-basepath="/cms/menu"
4849
content-basepath="null"
50+
prefetch="10"
4951
manager-name="null"
5052
menu-document-class="null"
5153
node-document-class="null"
@@ -66,6 +68,7 @@ persistence configuration has the following configuration:
6668
'enabled' => false,
6769
'menu_basepath' => '/cms/menu',
6870
'content_basepath' => null,
71+
'prefetch' => 10,
6972
'manager_name' => null,
7073
'menu_document_class' => null,
7174
'node_document_class' => null,
@@ -82,11 +85,6 @@ enabled
8285

8386
.. include:: partials/persistence_phpcr_enabled.rst.inc
8487

85-
manager_name
86-
""""""""""""
87-
88-
.. include:: partials/persistence_phpcr_manager_name.rst.inc
89-
9088
menu_basepath
9189
"""""""""""""
9290

@@ -95,7 +93,7 @@ menu_basepath
9593
Specifies the path in the PHPCR-ODM document hierarchy under which the menu
9694
documents can be found.
9795

98-
* This is the default location used by the
96+
* This is the default location used by the
9997
:doc:`MenuProvider <../../bundles/menu/menu_factory>` to locate menus.
10098
* This is the default location for newly created menus in the Sonata admin
10199
class.
@@ -115,8 +113,31 @@ the content branch of the document hierarchy in forms.
115113
If the :doc:`CoreBundle <../../bundles/core/index>` is registered, this will default to
116114
the value of ``%cmf_core.persistence.phpcr.basepath%/content``
117115

118-
menu_document
119-
"""""""""""""
116+
.. versionadded:: 1.1
117+
118+
The prefetch functionality was added in MenuBundle 1.1.
119+
120+
prefetch
121+
""""""""
122+
123+
**type**: ``integer`` **default**: ``10``
124+
125+
When rendering a menu, the whole menu tree needs to be loaded. To reduce the
126+
number of database requests that PHPCR needs to make, this setting makes the
127+
tree loader prefetch all menu nodes in one call.
128+
129+
``10`` should be enough for most cases, if you have deeper menu structures you
130+
might want to increase this.
131+
132+
To disable menu prefetch completely, set this option to ``0``.
133+
134+
manager_name
135+
""""""""""""
136+
137+
.. include:: partials/persistence_phpcr_manager_name.rst.inc
138+
139+
menu_document_class
140+
"""""""""""""""""""
120141

121142
**type**: ``string`` **default**:
122143
``Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu``
@@ -125,8 +146,8 @@ Specifies the document class which should represent an entire menu.
125146

126147
This setting is used by the admin class.
127148

128-
node_document
129-
"""""""""""""
149+
node_document_class
150+
"""""""""""""""""""
130151

131152
**type**: ``string`` **default**:
132153
``Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode``
@@ -175,7 +196,7 @@ The ``voters`` section enables you to enable and configure *pre-defined* :doc:`v
175196
.. code-block:: yaml
176197
177198
cmf_menu:
178-
# ...
199+
# ...
179200
voters:
180201
content_identity:
181202
content_key: ~

0 commit comments

Comments
 (0)