class JCategoryNode extends JObject


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

Helper class to load Categorytree

Properties

$id Primary key
integer $asset_id The id of the category in the asset table
integer $parent_id The id of the parent of category in the asset table, 0 for category root
integer $lft The lft value for this category in the category tree
integer $rgt The rgt value for this category in the category tree
integer $level The depth of this category's position in the category tree
integer $extension The extension this category is associated with
string $title The menu title for the category (a short name)
string $alias The the alias for the category
string $description Description of the category.
boolean $published The publication status of the category
boolean $checked_out Whether the category is or is not checked out
time $checked_out_time The time at which the category was checked out
integer $access Access level for the category
string $params JSON string of parameters
string $metadesc Metadata description
string $metakey Key words for meta data
string $metadata JSON string of other meta data
$created_user_id
time $created_time The time at which the category was created
$modified_user_id
time $modified_time The time at which the category was modified
integer $hits Nmber of times the category has been viewed
time $language The language for the category in xx-XX format
integer $numitems Number of items in this category or descendants of this category
$childrennumitems Number of children items
string $slug Slug fo the category (used in URL)
array $assets Array of assets

Methods

__construct($category = null, $constructor = null)

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
void
setParent(mixed $parent)

Set the parent of this category

void
addChild(JNode $child)

Add child to this node

void
removeChild(integer $id)

Remove a specific child

array
getChildren(boolean $recursive = false)

Get the children of this node

mixed
getParent()

Get the parent of this node

boolean
hasChildren()

Test if this node has children

boolean
hasParent()

Test if this node has a parent

void
setSibling(object $sibling, boolean $right = true)

Function to set the left or right sibling of a category

getSibling(boolean $right = true)

Returns the right or left sibling of a category

getParams()

Returns the category parameters

getMetadata()

Returns the category metadata

array
getPath()

Returns the category path to the root category

getAuthor(boolean $modified_user = false)

Returns the user that created the category

void
setAllLoaded()

Set to load all children

integer
getNumItems(boolean $recursive = false)

Returns the number of items.

Details

at line 617
JObject __construct($category = null, $constructor = null)

Class constructor

Parameters

$category
$constructor

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 641
void setParent(mixed $parent)

Set the parent of this category

If the category already has a parent, the link is unset

Parameters

mixed $parent JCategoryNode for the parent to be set or null

Return Value

void

at line 680
void addChild(JNode $child)

Add child to this node

If the child already has a parent, the link is unset

Parameters

JNode $child The child to be added.

Return Value

void

at line 696
void removeChild(integer $id)

Remove a specific child

Parameters

integer $id ID of a category

Return Value

void

at line 710
array getChildren(boolean $recursive = false)

Get the children of this node

Parameters

boolean $recursive False by default

Return Value

array The children

at line 742
mixed getParent()

Get the parent of this node

Return Value

mixed JNode or null

at line 754
boolean hasChildren()

Test if this node has children

Return Value

boolean True if there is a child

at line 766
boolean hasParent()

Test if this node has a parent

Return Value

boolean True if there is a parent

at line 781
void setSibling(object $sibling, boolean $right = true)

Function to set the left or right sibling of a category

Parameters

object $sibling JCategoryNode object for the sibling
boolean $right If set to false, the sibling is the left one

Return Value

void

at line 801
JCategoryNode getSibling(boolean $right = true)

Returns the right or left sibling of a category

Parameters

boolean $right If set to false, returns the left sibling

Return Value

JCategoryNode or null JCategoryNode object with the sibling information or null if there is no sibling on that side.

at line 826
JRegistry getParams()

Returns the category parameters

Return Value

JRegistry

at line 844
JRegistry getMetadata()

Returns the category metadata

Return Value

JRegistry A JRegistry object containing the metadata

at line 862
array getPath()

Returns the category path to the root category

Return Value

array

at line 876
JUser getAuthor(boolean $modified_user = false)

Returns the user that created the category

Parameters

boolean $modified_user Returns the modified_user when set to true

Return Value

JUser A JUser object containing a userid

at line 892
void setAllLoaded()

Set to load all children

Return Value

void

at line 910
integer getNumItems(boolean $recursive = false)

Returns the number of items.

Parameters

boolean $recursive If false number of children, if true number of descendants

Return Value

integer Number of children or descendants