[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Menu/ -> AbstractMenu.php (summary)

Joomla! Content Management System

Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 412 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 14 functions

  __construct()
  getInstance()
  setUser()
  getItem()
  setDefault()
  getDefault()
  setActive()
  getActive()
  getItems()
  getParams()
  getMenu()
  authorise()
  getUser()
  __get()

Functions
Functions that are not part of a class:

__construct($options = array()   X-Ref
Class constructor

param: array  $options  An array of configuration options.

getInstance($client, $options = array()   X-Ref
Returns a Menu object

param: string  $client   The name of the client
param: array   $options  An associative array of options
return: AbstractMenu  A menu object.

setUser($user)   X-Ref
Setter for the current user used to build menu.

param: User  $user  The new user to set.
return: void

getItem($id)   X-Ref
Get menu item by id

param: integer  $id  The item id
return: MenuItem|null  The item object if the ID exists or null if not found

setDefault($id, $language = '*')   X-Ref
Set the default item by id and language code.

param: integer  $id        The menu item id.
param: string   $language  The language code (since 1.6).
return: boolean  True if a menu item with the given ID exists

getDefault($language = '*')   X-Ref
Get the default item by language code.

param: string  $language  The language code, default value of * means all.
return: MenuItem|void  The item object or null when not found for given language

setActive($id)   X-Ref
Set the default item by id

param: integer  $id  The item id
return: MenuItem|void  The menu item representing the given ID if present or null otherwise

getActive()   X-Ref
Get menu item by id.

return: MenuItem|void  The item object if an active menu item has been set or null

getItems($attributes, $values, $firstonly = false)   X-Ref
Gets menu items by attribute

param: mixed    $attributes  The field name(s).
param: mixed    $values      The value(s) of the field. If an array, need to match field names
param: boolean  $firstonly   If true, only returns the first item found
return: MenuItem|MenuItem[]  An array of menu item objects or a single object if the $firstonly parameter is true

getParams($id)   X-Ref
Gets the parameter object for a certain menu item

param: integer  $id  The item id
return: Registry

getMenu()   X-Ref
Getter for the menu array

return: MenuItem[]

authorise($id)   X-Ref
Method to check Menu object authorization against an access control object and optionally an access extension object

param: integer  $id  The menu id
return: boolean

getUser()   X-Ref
Internal getter for the user. Returns the injected
one if any, or the current one if none.

return: User

__get($propName)   X-Ref
Magic getter for the user object. Returns the injected
one if any, or the current one if none.

Using a magic getter to preserve B/C when we stopped storing the user object upon construction of the menu object.
As the user property is not initialized anymore, this getter ensures any class extending
this one can still use $instance->user and get a proper value.

param: string  $propName  Name of the missing or protected property.
return: User|null



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer