CoolCMS API

AdminMenuItem extends AdminMenuItem
in package

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_admin_system_menu_items'
#[TableAlias]
'adminMenuItem'

Table of Contents

Properties

$active  : bool
$class  : string|null
$comment  : string|null
$dashboardOrder  : int
Tile order within its section. `0` means "order by menu", not "first": otherwise every newly enabled tile would jump to the top and the admin would have to renumber all others.
$dashboardTile  : bool
$hasSubmenu  : bool|null
$id  : int|null
$imgClass  : string|null
$level  : int
$lft  : int
$menuId  : int
$page  : TPage|null
$pageId  : int|null
$params  : string|null
$parentId  : int|null
$rgt  : int
$separator  : bool
$translations  : Collection
$ulClass  : string|null
$ulId  : string|null

Methods

__construct()  : mixed
addTranslation()  : $this
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getActive()  : bool
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getClass()  : string|null
getComment()  : string|null
getDashboardOrder()  : int
getDashboardTile()  : bool
getHasSubmenu()  : bool|null
getId()  : int|null
getImgClass()  : string|null
getLevel()  : int
getLft()  : int
getMenuId()  : int
getPage()  : TPage|null
getPageId()  : int|null
getParams()  : string|null
getParamsArray()  : array<string, scalar>
Returns the link parameters as an array. Invalid or non-object JSON means no parameters; a broken menu item must not break the whole menu.
getParentId()  : int|null
getRgt()  : int
getSeparator()  : bool
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUlClass()  : string|null
getUlId()  : string|null
hasSubmenu()  : bool|null
isActive()  : bool
isDashboardTile()  : bool
isPersisted()  : bool
isSeparator()  : bool
removeTranslation()  : $this
setActive()  : $this
setClass()  : $this
setComment()  : $this
setDashboardOrder()  : $this
setDashboardTile()  : $this
setHasSubmenu()  : $this
setId()  : $this
setImgClass()  : $this
setLevel()  : $this
setLft()  : $this
setMenuId()  : $this
setPage()  : $this
setPageId()  : $this
setParams()  : TTranslation>
setParentId()  : $this
setRgt()  : $this
setSeparator()  : $this
setTranslations()  : $this
setUlClass()  : $this
setUlId()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$active

protected bool $active = true
Attributes
#[Column]
$name: 'active'
$type: 'boolean'

$class

protected string|null $class = null
Attributes
#[Column]
$name: 'class'
$type: 'string'
$length: 255
$nullable: true

$comment

protected string|null $comment = null
Attributes
#[Column]
$name: 'comment'
$type: 'string'
$length: 255
$nullable: true

$dashboardOrder

Tile order within its section. `0` means "order by menu", not "first": otherwise every newly enabled tile would jump to the top and the admin would have to renumber all others.

protected int $dashboardOrder = 0
Attributes
#[Column]
$name: 'dashboard_order'
$type: 'integer'
$options: ['default' => 0]

$dashboardTile

protected bool $dashboardTile = false
Attributes
#[Column]
$name: 'dashboard_tile'
$type: 'boolean'
$options: ['default' => 0]

$hasSubmenu

protected bool|null $hasSubmenu = false
Attributes
#[Column]
$name: 'has_submenu'
$type: 'boolean'
$nullable: true

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'menu_item_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$imgClass

protected string|null $imgClass = null
Attributes
#[Column]
$name: 'imgClass'
$type: 'string'
$length: 255
$nullable: true

$level

protected int $level = 0
Attributes
#[Column]
$name: 'level'
$type: 'integer'

$lft

protected int $lft = 0
Attributes
#[Column]
$name: 'lft'
$type: 'integer'

$menuId

protected int $menuId = 1
Attributes
#[Column]
$name: 'menu_id'
$type: 'integer'

$page

protected TPage|null $page = null

the Doctrine association (many-to-one to AdminPage) is defined by the concrete entity per module

Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\AdminPage::class
#[JoinColumn]
$name: 'cms_admin_system_pages_page_id'
$referencedColumnName: 'page_id'
$nullable: true
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\AdminPage::class
$fetch: "LAZY"

$pageId

protected int|null $pageId = null
Attributes
#[Column]
$name: 'cms_admin_system_pages_page_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]

$params

protected string|null $params = null
Attributes
#[Column]
$name: 'params'
$type: 'text'
$nullable: true

$parentId

protected int|null $parentId = null
Attributes
#[Column]
$name: 'parent_id'
$type: 'integer'
$nullable: true

$rgt

protected int $rgt = 0
Attributes
#[Column]
$name: 'rgt'
$type: 'integer'

$separator

protected bool $separator = false
Attributes
#[Column]
$name: 'separator'
$type: 'boolean'

$translations

protected Collection $translations
Attributes
#[CollectionOf]
\App\UI\Admin\System\Models\Entities\AdminMenuItemText::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\System\Models\Entities\AdminMenuItemText::class
$mappedBy: 'parent'
$cascade: ["persist", "remove"]
$orphanRemoval: true
$fetch: "LAZY"

$ulClass

protected string|null $ulClass = null
Attributes
#[Column]
$name: 'ul_class'
$type: 'string'
$length: 255
$nullable: true

$ulId

protected string|null $ulId = null
Attributes
#[Column]
$name: 'ul_id'
$type: 'string'
$length: 255
$nullable: true

Methods

__construct()

public __construct([int|null $id = null ][, int $menuId = 1 ][, int|null $pageId = null ][, mixed $page = null ][, string|null $params = null ][, int $lft = 0 ][, int $rgt = 0 ][, int|null $parentId = null ][, int $level = 0 ][, string|null $class = null ][, string|null $ulClass = null ][, string|null $ulId = null ][, bool $separator = false ][, string|null $comment = null ][, bool|null $hasSubmenu = false ][, string|null $imgClass = null ][, bool $active = true ][, bool $dashboardTile = false ][, int $dashboardOrder = 0 ][, Collection $translations = new ArrayCollection() ]) : mixed
Parameters
$id : int|null = null
$menuId : int = 1
$pageId : int|null = null
$page : mixed = null
$params : string|null = null
$lft : int = 0
$rgt : int = 0
$parentId : int|null = null
$level : int = 0
$class : string|null = null
$ulClass : string|null = null
$ulId : string|null = null
$separator : bool = false
$comment : string|null = null
$hasSubmenu : bool|null = false
$imgClass : string|null = null
$active : bool = true
$dashboardTile : bool = false
$dashboardOrder : int = 0
$translations : Collection = new ArrayCollection()

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAllTraits()

Returns all traits the class uses, including those used by parent classes and nested traits.

public getAllTraits() : array<string, string>
Return values
array<string, string>

getClass()

public getClass() : string|null
Return values
string|null

getComment()

public getComment() : string|null
Return values
string|null

getDashboardOrder()

public getDashboardOrder() : int
Return values
int

getDashboardTile()

public getDashboardTile() : bool
Return values
bool

getHasSubmenu()

public getHasSubmenu() : bool|null
Return values
bool|null

getImgClass()

public getImgClass() : string|null
Return values
string|null

getPage()

public getPage() : TPage|null
Return values
TPage|null

getPageId()

public getPageId() : int|null
Return values
int|null

getParams()

public getParams() : string|null
Return values
string|null

getParamsArray()

Returns the link parameters as an array. Invalid or non-object JSON means no parameters; a broken menu item must not break the whole menu.

public getParamsArray() : array<string, scalar>
Return values
array<string, scalar>

getParentId()

public getParentId() : int|null
Return values
int|null

getSeparator()

public getSeparator() : bool
Return values
bool

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

getUlClass()

public getUlClass() : string|null
Return values
string|null

getUlId()

public getUlId() : string|null
Return values
string|null

hasSubmenu()

public hasSubmenu() : bool|null
Return values
bool|null

isDashboardTile()

public isDashboardTile() : bool
Return values
bool

isSeparator()

public isSeparator() : bool
Return values
bool

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setClass()

public setClass(string|null $class) : $this
Parameters
$class : string|null
Return values
$this

setComment()

public setComment(string|null $comment) : $this
Parameters
$comment : string|null
Return values
$this

setDashboardOrder()

public setDashboardOrder(int $dashboardOrder) : $this
Parameters
$dashboardOrder : int
Return values
$this

setDashboardTile()

public setDashboardTile(bool $dashboardTile) : $this
Parameters
$dashboardTile : bool
Return values
$this

setHasSubmenu()

public setHasSubmenu(bool|null $hasSubmenu) : $this
Parameters
$hasSubmenu : bool|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setImgClass()

public setImgClass(string|null $imgClass) : $this
Parameters
$imgClass : string|null
Return values
$this

setLevel()

public setLevel(int $level) : $this
Parameters
$level : int
Return values
$this

setLft()

public setLft(int $lft) : $this
Parameters
$lft : int
Return values
$this

setMenuId()

public setMenuId(int $menuId) : $this
Parameters
$menuId : int
Return values
$this

setPage()

public setPage(TPage|null $page) : $this
Parameters
$page : TPage|null
Return values
$this

setPageId()

public setPageId(int|null $pageId) : $this
Parameters
$pageId : int|null
Return values
$this

setParams()

public setParams(string|null $params) : TTranslation>
Parameters
$params : string|null
Return values
TTranslation>

setParentId()

public setParentId(int|null $parentId) : $this
Parameters
$parentId : int|null
Return values
$this

setRgt()

public setRgt(int $rgt) : $this
Parameters
$rgt : int
Return values
$this

setSeparator()

public setSeparator(bool $separator) : $this
Parameters
$separator : bool
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

setUlClass()

public setUlClass(string|null $ulClass) : $this
Parameters
$ulClass : string|null
Return values
$this

setUlId()

public setUlId(string|null $ulId) : $this
Parameters
$ulId : string|null
Return values
$this

getTraitsRecursive()

Walks the trait list recursively and collects nested traits too.

private static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
$traits : array<string, string>
Return values
array<string, string>
On this page

Search results