Piwik\Category\
Base type for subcategories.
All widgets within a subcategory will be rendered in the Matomo (formerly Piwik) reporting UI under the same page. By default
you do not have to specify any subcategory as they are created automatically. Only create a subcategory if you
want to change the name for a specific subcategoryId or if you want to specify a different order so the subcategory
appears eg at a different order in the reporting menu. It also affects the order of reports in
API.getReportMetadata
and wherever we display any reports.
To define a subcategory just place a subclass within the Categories
folder of your plugin.
Subcategories can also be added through the Subcategory.addSubcategories event.
The class defines the following methods:
setId()
— Sets (overwrites) the id of the subcategory see $id.getId()
— Get the id of the subcategory.getCategoryId()
— Get the specified categoryId see $categoryId.setCategoryId()
— Sets (overwrites) the categoryId see $categoryId.setName()
— Sets (overwrites) the name see $name and $id.getName()
— Get the name of the subcategory.setOrder()
— Sets (overwrites) the order see $order.getOrder()
— Get the order of the subcategory.getHelp()
— Get the help text (if any) for this category.setId()
Sets (overwrites) the id of the subcategory see $id.
$id
(string
) —
A translation key eg 'General_Overview'.Subcategory
value.getId()
Get the id of the subcategory.
string
value.getCategoryId()
Get the specified categoryId see $categoryId.
string
value.setCategoryId()
Sets (overwrites) the categoryId see $categoryId.
It accepts the following parameter(s):
$categoryId
(string
) —It returns a Subcategory
value.
setName()
Sets (overwrites) the name see $name and $id.
$name
(string
) —
A translation key eg 'General_Overview'.Subcategory
value.getName()
Get the name of the subcategory.
string
value.setOrder()
Sets (overwrites) the order see $order.
It accepts the following parameter(s):
$order
(int
) —It returns a Subcategory
value.
getOrder()
Get the order of the subcategory.
int
value.getHelp()
Get the help text (if any) for this category.
null
value.