PHP Class Devise\Menus\MenusManager

Show file Open project: devisephp/cms Class Usage Examples

Public Properties

Property Type Description
$errors errors Keeps any errors from validation
$message message Generic message for success or failure of method execution

Protected Properties

Property Type Description
$Menu DvsMenu Keeps up with model for DvsMenu
$MenuItem DvsMenuItem Keeps up with model for DvsMenuItem

Public Methods

Method Description
__construct ( DvsMenu $Menu, DvsMenuItem $MenuItem, Framework $Framework ) Construct a new user manager
createMenu ( array $input ) : Menu Creates a new menu
createRules ( ) : array These are create rules for a menu
updateMenu ( $id, array $input ) : Menu Updates the active field of a Menu
updateRules ( integer $id ) : array These are the update rules for a menu given an id

Protected Methods

Method Description
createNewMenuItems ( Menu $menu, array $items, array $order ) : array($items, Create any new menu items that don't exist yet and then inject them into our items array also we update the order array to include any new menu items that we just created
syncMenuItems ( Menu $menu, $input ) : void Sync the menu items with this menu, this creates new items, reorders the positions and updates parent item ids too.

Method Details

__construct() public method

Construct a new user manager
public __construct ( DvsMenu $Menu, DvsMenuItem $MenuItem, Framework $Framework )
$Menu DvsMenu
$MenuItem DvsMenuItem
$Framework Devise\Support\Framework

createMenu() public method

Creates a new menu
public createMenu ( array $input ) : Menu
$input array
return Menu || null

createNewMenuItems() protected method

Create any new menu items that don't exist yet and then inject them into our items array also we update the order array to include any new menu items that we just created
protected createNewMenuItems ( Menu $menu, array $items, array $order ) : array($items,
$menu Menu
$items array
$order array
return array($items,

createRules() public method

These are create rules for a menu
public createRules ( ) : array
return array

syncMenuItems() protected method

Sync the menu items with this menu, this creates new items, reorders the positions and updates parent item ids too.
protected syncMenuItems ( Menu $menu, $input ) : void
$menu Menu
$input
return void

updateMenu() public method

Updates the active field of a Menu
public updateMenu ( $id, array $input ) : Menu
$id
$input array
return Menu || null

updateRules() public method

These are the update rules for a menu given an id
public updateRules ( integer $id ) : array
$id integer
return array

Property Details

$Menu protected property

Keeps up with model for DvsMenu
protected DvsMenu $Menu
return DvsMenu

$MenuItem protected property

Keeps up with model for DvsMenuItem
protected DvsMenuItem $MenuItem
return DvsMenuItem

$errors public property

Keeps any errors from validation
public errors $errors
return errors

$message public property

Generic message for success or failure of method execution
public message $message
return message