class JMenu extends JObject


Located at : UKNOWVA_ROOT/libraries/joomla/application/menu.php

JMenu class

Methods

__construct(array $options = array())

Class constructor

string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
static JMenu
getInstance(string $client, array $options = array())

Returns a JMenu object

mixed
getItem(integer $id)

Get menu item by id

boolean
setDefault(integer $id, string $language = '')

Set the default item by id and language code.

object
getDefault(string $language = '*')

Get the default item by language code.

mixed
setActive(integer $id)

Set the default item by id

object
getActive()

Get menu item by id.

array
getItems(string $attributes, string $values, boolean $firstonly = false)

Gets menu items by attribute

getParams(integer $id)

Gets the parameter object for a certain menu item

array
getMenu()

Getter for the menu array

boolean
authorise(integer $id)

Method to check JMenu object authorization against an access control object and optionally an access extension object

array
load()

Loads the menu items

Details

at line 54
JObject __construct(array $options = array())

Class constructor

Parameters

array $options An array of configuration options.

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

at line 82
static JMenu getInstance(string $client, array $options = array())

Returns a JMenu object

Parameters

string $client The name of the client
array $options An associative array of options

Return Value

JMenu A menu object.

at line 124
mixed getItem(integer $id)

Get menu item by id

Parameters

integer $id The item id

Return Value

mixed The item object, or null if not found

at line 144
boolean setDefault(integer $id, string $language = '')

Set the default item by id and language code.

Parameters

integer $id The menu item id.
string $language The language cod (since 1.6).

Return Value

boolean True, if succesful

at line 162
object getDefault(string $language = '*')

Get the default item by language code.

Parameters

string $language The language code, default value of * means all.

Return Value

object The item object

at line 184
mixed setActive(integer $id)

Set the default item by id

Parameters

integer $id The item id

Return Value

mixed If successfull the active item, otherwise null

at line 202
object getActive()

Get menu item by id.

Return Value

object The item object.

at line 223
array getItems(string $attributes, string $values, boolean $firstonly = false)

Gets menu items by attribute

Parameters

string $attributes The field name
string $values The value of the field
boolean $firstonly If true, only returns the first item found

Return Value

array

at line 273
JRegistry getParams(integer $id)

Gets the parameter object for a certain menu item

Parameters

integer $id The item id

Return Value

JRegistry A JRegistry object

at line 290
array getMenu()

Getter for the menu array

Return Value

array

at line 305
boolean authorise(integer $id)

Method to check JMenu object authorization against an access control object and optionally an access extension object

Parameters

integer $id The menu id

Return Value

boolean True if authorised

at line 325
array load()

Loads the menu items

Return Value

array