MenuLists final readonly class
Minn\Rest\MenuLists · public/minn/src/Minn/Rest/MenuLists.php · 84 lines
The menus and menu items lists, served as the reference serves them: the menus as the nav_menu taxonomy's term list (its parameters through rest_nav_menu_collection_params, its query through rest_nav_menu_query, counted without the page), the items as the nav_menu_item type's post list with its own parameters (Rest\MenuItemCollectionParams), each in its own shape.
Uses 24 (show)
Constants and properties
| private | TAXONOMY = 'nav_menu' | |
| private | ITEM_TYPE = 'nav_menu_item' | |
| private | readonly Minn\Rest\PostsController $posts | Promoted from the constructor. |
| prop | readonly Minn\Content\Menus $menus | Promoted from the constructor. |
| prop | readonly Minn\Rest\MenuObject $menuObject | Promoted from the constructor. |
| prop | readonly Minn\Rest\MenuItemObject $itemObject | Promoted from the constructor. |
| prop | readonly Minn\Rest\Caller $caller | Promoted from the constructor. |
Public
| new | __construct(Minn\Rest\PostsController $posts, Minn\Content\Menus $menus, Minn\Rest\MenuObject $menuObject, Minn\Rest\MenuItemObject $itemObject, Minn\Rest\Caller $caller)# | |
| method | menus(Minn\Http\Request $request): Minn\Http\Response# | The menus: edit context for one who may edit menus, a post's menus only for a menu item the caller may read (an unknown post is a bad parameter), then get_terms, or the post's own terms, as asked. |
| method | items(Minn\Http\Request $request): Minn\Http\Response# | The menu items, as the post list of their type: every list parameter honoured, each item in its own shape. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | termsReadable(Minn\Objects\Post $post, array $objectTypes): bool# | Whether the caller may see a post's menus: the post one of the taxonomy's types, and publicly viewable or one the caller may read.
|
Nothing matches.