Piwik\Category\

Subcategory

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.

Methods

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.

Signature

  • It accepts the following parameter(s):
    • $id (string) — A translation key eg 'General_Overview'.
  • It returns a Subcategory value.

getId()

Get the id of the subcategory.

Signature

  • It returns a string value.

getCategoryId()

Get the specified categoryId see $categoryId.

Signature

  • It returns a string value.

setCategoryId()

Sets (overwrites) the categoryId see $categoryId.

Signature

  • It accepts the following parameter(s):

    • $categoryId (string) —
  • It returns a Subcategory value.

setName()

Sets (overwrites) the name see $name and $id.

Signature

  • It accepts the following parameter(s):
    • $name (string) — A translation key eg 'General_Overview'.
  • It returns a Subcategory value.

getName()

Get the name of the subcategory.

Signature

  • It returns a string value.

setOrder()

Sets (overwrites) the order see $order.

Signature

  • It accepts the following parameter(s):

    • $order (int) —
  • It returns a Subcategory value.

getOrder()

Get the order of the subcategory.

Signature

  • It returns a int value.

getHelp()

Get the help text (if any) for this category.

Signature

  • It returns a null value.