PHP Class Piwik\Category\Subcategory

All widgets within a subcategory will be rendered in the 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 specifiy 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 {@hook Subcategory.addSubcategories} event.
显示文件 Open project: piwik/piwik Class Usage Examples

Protected Properties

Property Type Description
$categoryId See {@link Piwik\Widget\WidgetConfig::setCategoryId()`} or {@link Piwik\Report\getCategoryId()}.
$id For example you might want to have the actual GoalId (eg '4') in the URL but the actual goal name in the submenu (eg 'Downloads'). In this case one should specify $id=4;$name='Downloads'.
$name string The name that shall be used in the menu etc, defaults to the specified {@link $id}. See {@link $id}.
$order integer The order of the subcategory. The lower the value the earlier a widget or a report will be displayed.

Public Methods

Method Description
getCategoryId ( ) : string Get the specifed categoryId see {@link $categoryId}.
getId ( ) : string Get the id of the subcategory.
getName ( ) : string Get the name of the subcategory.
getOrder ( ) : integer Get the order of the subcategory.
setCategoryId ( string $categoryId ) : static Sets (overwrites) the categoryId see {@link $categoryId}.
setId ( string $id ) : static Sets (overwrites) the id of the subcategory see {@link $id}.
setName ( string $name ) : static Sets (overwrites) the name see {@link $name} and {@link $id}.
setOrder ( integer $order ) : static Sets (overwrites) the order see {@link $order}.

Method Details

getCategoryId() public method

Get the specifed categoryId see {@link $categoryId}.
public getCategoryId ( ) : string
return string

getId() public method

Get the id of the subcategory.
public getId ( ) : string
return string

getName() public method

Get the name of the subcategory.
public getName ( ) : string
return string

getOrder() public method

Get the order of the subcategory.
public getOrder ( ) : integer
return integer

setCategoryId() public method

Sets (overwrites) the categoryId see {@link $categoryId}.
public setCategoryId ( string $categoryId ) : static
$categoryId string
return static

setId() public method

Sets (overwrites) the id of the subcategory see {@link $id}.
public setId ( string $id ) : static
$id string A translation key eg 'General_Overview'.
return static

setName() public method

Sets (overwrites) the name see {@link $name} and {@link $id}.
public setName ( string $name ) : static
$name string A translation key eg 'General_Overview'.
return static

setOrder() public method

Sets (overwrites) the order see {@link $order}.
public setOrder ( integer $order ) : static
$order integer
return static

Property Details

$categoryId protected_oe property

See {@link Piwik\Widget\WidgetConfig::setCategoryId()`} or {@link Piwik\Report\getCategoryId()}.
protected $categoryId

$id protected_oe property

For example you might want to have the actual GoalId (eg '4') in the URL but the actual goal name in the submenu (eg 'Downloads'). In this case one should specify $id=4;$name='Downloads'.
protected $id

$name protected_oe property

The name that shall be used in the menu etc, defaults to the specified {@link $id}. See {@link $id}.
protected string $name
return string

$order protected_oe property

The order of the subcategory. The lower the value the earlier a widget or a report will be displayed.
protected int $order
return integer