Jinya CMS

MenuItem
in package
Uses EntityTrait, FindableEntityTrait

This class contains a menu item. A menu item is a class containing information about an entry in a menu.

Tags

Table of Contents

$artistId  : int|null
$blogHomePage  : bool|null
$categoryId  : int|null
$classicPageId  : int|null
$formId  : int|null
$galleryId  : int|null
$highlighted  : bool
$id  : int
$menuId  : int|null
$modernPageId  : int|null
$parentId  : int|null
$position  : int
$route  : string|null
$title  : string
findByMenu()  : Iterator<string|int, MenuItem>
Finds all menu items that are direct children of the given menu
findByMenuAndPosition()  : MenuItem|null
Finds a menu item by its parent menu and the position
findByMenuItemAndPosition()  : MenuItem|null
Finds a menu item by its parent menu item and the position
findByParent()  : Iterator<string|int, MenuItem>
Finds all menu items that are direct children of the given menu item
findByRoute()  : MenuItem|null
Finds the menu item with the given route
format()  : array<string, array<int|string, mixed>|bool|int|string|null>
Formats the given menu item
getArtist()  : Artist|null
Gets the associated artist
getBlogCategory()  : BlogCategory|null
Gets the associated category
getClassicPage()  : ClassicPage|null
Gets the associated page
getForm()  : Form|null
Gets the associated form
getGallery()  : Gallery|null
Gets the associated gallery
getItems()  : Iterator<string|int, MenuItem>
Gets the menu items
getMenu()  : Menu|null
Gets the menu
getModernPage()  : ModernPage|null
Gets the associated segment page
getParent()  : MenuItem|null
Gets the parent
formatIterator()  : array<int, mixed>
Format an iterator

Properties

$artistId

public int|null $artistId = null

The ID of the artist this menu item should render

Tags

$blogHomePage

public bool|null $blogHomePage = false

If it is set to true, this menu item renders the blog home page

Tags

$categoryId

public int|null $categoryId = null

The ID of the blog category this menu item should render

Tags

$classicPageId

public int|null $classicPageId = null

The ID of the page this menu item should render

Tags

$formId

public int|null $formId = null

The ID of the form this menu item should render

Tags

$galleryId

public int|null $galleryId = null

The ID of the gallery this menu item should render

Tags

$highlighted

public bool $highlighted = false

When true, the menu item should get a special highlighting in the frontend. Themes must respect the decision of the artist

Tags

$menuId

public int|null $menuId = null

The ID of the menu this menu item belongs to. If the menu item has a menu item as parent, this value is null

Tags

$modernPageId

public int|null $modernPageId = null

The ID of the segment page this menu item should render

Tags

$parentId

public int|null $parentId = null

The ID of the menu item, this menu item has as parent. If the menu item has a menu as parent, this value is null

Tags

$route

public string|null $route = null

The link of the menu item. This link can be either an absolute URL, a relative URL or null. Absolute URLs open the link directly, while relative URLs are handled by the frontend controller and will render different entities. Usually a null value indicates that the menu item is used as a parent item, which has no link but rather opens and shows the subitems

Tags

$title

public string $title

The title of the menu item. This title is supposed to be displayed in the frontend

Tags

Methods

findByMenu()

Finds all menu items that are direct children of the given menu

public static findByMenu(int $menuId) : Iterator<string|int, MenuItem>
Parameters
$menuId : int
Tags
Return values
Iterator<string|int, MenuItem>

findByMenuAndPosition()

Finds a menu item by its parent menu and the position

public static findByMenuAndPosition(int $menuId, int $position) : MenuItem|null
Parameters
$menuId : int
$position : int
Tags
Return values
MenuItem|null

findByMenuItemAndPosition()

Finds a menu item by its parent menu item and the position

public static findByMenuItemAndPosition(int $parentId, int $position) : MenuItem|null
Parameters
$parentId : int
$position : int
Tags
Return values
MenuItem|null

findByParent()

Finds all menu items that are direct children of the given menu item

public static findByParent(int $parentId) : Iterator<string|int, MenuItem>
Parameters
$parentId : int
Tags
Return values
Iterator<string|int, MenuItem>

findByRoute()

Finds the menu item with the given route

public static findByRoute(null|string $route) : MenuItem|null
Parameters
$route : null|string
Tags
Return values
MenuItem|null

format()

Formats the given menu item

public format() : array<string, array<int|string, mixed>|bool|int|string|null>
Tags
Return values
array<string, array<int|string, mixed>|bool|int|string|null>

getArtist()

Gets the associated artist

public getArtist() : Artist|null
Tags
Return values
Artist|null

getForm()

Gets the associated form

public getForm() : Form|null
Tags
Return values
Form|null

getGallery()

Gets the associated gallery

public getGallery() : Gallery|null
Tags
Return values
Gallery|null

getItems()

Gets the menu items

public getItems() : Iterator<string|int, MenuItem>
Tags
Return values
Iterator<string|int, MenuItem>

getMenu()

Gets the menu

public getMenu() : Menu|null
Tags
Return values
Menu|null

formatIterator()

Format an iterator

private formatIterator(Iterator $iterator) : array<int, mixed>
Parameters
$iterator : Iterator
Tags
Return values
array<int, mixed>

Search results