Categories

Implements CategoryInterface

Categories Class.

since

1.6

package

Application

Methods

__construct

Class constructor

__construct(array options) : mixed
since

1.6

Arguments

options

arrayArray of options

Response

mixed

_load

Load method

_load(int id) : void
since

1.6

Arguments

id

intId of category to load

get

Loads a specific category and all its children in a CategoryNode object.

get(mixed id = 'root', bool forceload = false) : \Joomla\CMS\Categories\CategoryNode|null
since

1.6

Arguments

id

mixedan optional id integer or equal to 'root'

forceload

boolTrue to force the _load method to execute

Response

\Joomla\CMS\Categories\CategoryNode|nullCategoryNode object or null if $id is not valid

getExtension

Returns the extension of the category.

getExtension() : string
since

3.9.0

Response

stringThe extension

getInstance

Returns a reference to a Categories object

getInstance(string extension, array options = array()) : \Joomla\CMS\Categories\Categories|bool
static deprecated
since

1.6

deprecated

5.0 Use the ComponentInterface to get the categories

Arguments

extension

stringName of the categories extension

options

arrayAn array of options

Response

\Joomla\CMS\Categories\Categories|boolCategories object on success, boolean false if an object does not exist

Properties

instances

Array to hold the object instances

static
since

1.6

Type(s)

Categories[]

_nodes

Array of category nodes

since

1.6

Type(s)

CategoryNode[]

_checkedCategories

Array of checked categories -- used to save values when _nodes are null

since

1.6

Type(s)

bool[]

_extension

Name of the extension the categories belong to

since

1.6

Type(s)

string

_table

Name of the linked content table to get category content count

since

1.6

Type(s)

string

_field

Name of the category field

since

1.6

Type(s)

string

_key

Name of the key field

since

1.6

Type(s)

string

_statefield

Name of the items state field

since

1.6

Type(s)

string

_options

Array of options

since

1.6

Type(s)

array