contentbox.model.menu

Class Menu

railo-context.Component
        extended by contentbox.model.menu.Menu
Class Attributes:
  • entityname : cbMenu
  •  
  • cacheuse : read-write
  •  
  • table : cb_menu
  •  
  • synchronized : false
  •  
  • cachename : cbMenu
  •  
  • accessors : false
  •  
  • persistent : true
  •  

    ContentBox - A Modular Content Platform Copyright 2012 by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com Apache License, Version 2.0 Copyright Since [2012] [Luis Majano and Ortus Solutions,Corp] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Core Menu Entity

    Property Summary
    type property default serializable required
    any createdDate


    • notnull = true
    • ormtype = timestamp
    • update = false
    true false
    any listClass


    • ormtype = string
    • length = 160
    true false
    any listType


    • ormtype = string
    • length = 20
    ul true false
    any menuClass


    • ormtype = string
    • length = 160
    true false
    any menuID


    • fieldtype = id
    • generator = native
    • setter = no
    true false
    array menuItems


    • inverse = true
    • fieldtype = one-to-many
    • cascade = all-delete-orphan
    • singularname = menuItem
    • fkcolumn = FK_menuID
    • cfc = contentbox.model.menu.item.BaseMenuItem
    • lazy = extra
    true false
    any menuItemService


    • inject = menuItemService@cb
    • persistent = false
    true false
    any menuService


    • inject = menuService@cb
    • persistent = false
    true false
    any ORMService


    • inject = coldbox:plugin:ORMService
    • persistent = false
    true false
    any slug


    • unique = true
    • notnull = true
    • ormtype = string
    • index = idx_menuslug
    • length = 200
    true false
    any title


    • notnull = true
    • ormtype = string
    • index = idx_menutitle
    • length = 200
    true false
    Constructor Summary
    init()
          constructor.
    Method Summary
    Menu addMenuItem(any menuItem)
    private array createMenuItems(array rawData)
         Recusive function to build menu items hierarchy from raw data.
    string getCreatedDate()
    string getListClass()
    string getListType()
    struct getMemento()
         Get a flat representation of this menu.
    string getMenuClass()
    string getMenuID()
    string getMenuItems()
    string getMenuItemService()
    string getMenuService()
    string getORMService()
    array getRootMenuItems()
         Retrieves root menu items (only items with no parents).
    string getSlug()
    string getTitle()
    boolean hasMenuItem([any menuItem])
    boolean isLoaded()
         is loaded?.
    Menu populateMenuItems(array rawData)
         Creates menu items from raw data object.
    void preInsert()
    boolean removeMenuItem(any menuItem)
    any setCreatedDate(any createdDate)
    any setListClass(any listClass)
    any setListType(any listType)
    any setMenuClass(any menuClass)
    Menu setMenuItems(array menuItems)
    any setMenuItemService(any menuItemService)
    any setMenuService(any menuService)
    any setORMService(any ORMService)
    any setSlug(any slug)
    any setTitle(any title)
     
    Methods inherited from class railo-context.Component
    None

    Constructor Detail

    init

    public init()

    constructor


    Property Detail

    createdDate

    property any createdDate

    Attributes:
    required - false
    notnull - true
    ormtype - timestamp
    update - false
    serializable - true

    listClass

    property any listClass

    Attributes:
    required - false
    ormtype - string
    length - 160
    serializable - true

    listType

    property any listType = [ul]

    Attributes:
    required - false
    ormtype - string
    length - 20
    serializable - true

    menuClass

    property any menuClass

    Attributes:
    required - false
    ormtype - string
    length - 160
    serializable - true

    menuID

    property any menuID

    Attributes:
    required - false
    fieldtype - id
    generator - native
    serializable - true
    setter - no

    menuItems

    property array menuItems

    Attributes:
    required - false
    inverse - true
    fieldtype - one-to-many
    cascade - all-delete-orphan
    singularname - menuItem
    fkcolumn - FK_menuID
    serializable - true
    cfc - contentbox.model.menu.item.BaseMenuItem
    lazy - extra

    menuItemService

    property any menuItemService

    Attributes:
    required - false
    inject - menuItemService@cb
    persistent - false
    serializable - true

    menuService

    property any menuService

    Attributes:
    required - false
    inject - menuService@cb
    persistent - false
    serializable - true

    ORMService

    property any ORMService

    Attributes:
    required - false
    inject - coldbox:plugin:ORMService
    persistent - false
    serializable - true

    slug

    property any slug

    Attributes:
    unique - true
    required - false
    notnull - true
    ormtype - string
    index - idx_menuslug
    length - 200
    serializable - true

    title

    property any title

    Attributes:
    required - false
    notnull - true
    ormtype - string
    index - idx_menutitle
    length - 200
    serializable - true

    Method Detail

    addMenuItem

    public Menu addMenuItem(any menuItem)

    Parameters:
    menuItem

    createMenuItems

    private array createMenuItems(array rawData)

    Recusive function to build menu items hierarchy from raw data

    Parameters:
    rawData - The raw data definitions for the menu items

    getCreatedDate

    public string getCreatedDate()


    getListClass

    public string getListClass()


    getListType

    public string getListType()


    getMemento

    public struct getMemento()

    Get a flat representation of this menu slugCache.hint Cache of slugs to prevent infinite recursions


    getMenuClass

    public string getMenuClass()


    getMenuID

    public string getMenuID()


    getMenuItems

    public string getMenuItems()


    getMenuItemService

    public string getMenuItemService()


    getMenuService

    public string getMenuService()


    getORMService

    public string getORMService()


    getRootMenuItems

    public array getRootMenuItems()

    Retrieves root menu items (only items with no parents)


    getSlug

    public string getSlug()


    getTitle

    public string getTitle()


    hasMenuItem

    public boolean hasMenuItem([any menuItem])

    Parameters:
    menuItem

    isLoaded

    public boolean isLoaded()

    is loaded?


    populateMenuItems

    public Menu populateMenuItems(array rawData)

    Creates menu items from raw data object

    Parameters:
    rawData - The raw data from which to create menu items

    preInsert

    public void preInsert()


    removeMenuItem

    public boolean removeMenuItem(any menuItem)

    Parameters:
    menuItem

    setCreatedDate

    public any setCreatedDate(any createdDate)

    Parameters:
    createdDate

    setListClass

    public any setListClass(any listClass)

    Parameters:
    listClass

    setListType

    public any setListType(any listType)

    Parameters:
    listType

    setMenuClass

    public any setMenuClass(any menuClass)

    Parameters:
    menuClass

    setMenuItems

    public Menu setMenuItems(array menuItems)

    Parameters:
    menuItems

    setMenuItemService

    public any setMenuItemService(any menuItemService)

    Parameters:
    menuItemService

    setMenuService

    public any setMenuService(any menuService)

    Parameters:
    menuService

    setORMService

    public any setORMService(any ORMService)

    Parameters:
    ORMService

    setSlug

    public any setSlug(any slug)

    Parameters:
    slug

    setTitle

    public any setTitle(any title)

    Parameters:
    title