PHP Класс 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.
Показать файл
Открыть проект
Примеры использования класса
Защищенные свойства (Protected)
Свойство |
Тип |
Описание |
|
$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. |
|
Открытые методы
Метод |
Описание |
|
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}. |
|
Описание методов
getCategoryId()
публичный Метод
Get the specifed categoryId see {@link $categoryId}.
Get the id of the subcategory.
getName()
публичный Метод
Get the name of the subcategory.
getOrder()
публичный Метод
Get the order of the subcategory.
setCategoryId()
публичный Метод
Sets (overwrites) the categoryId see {@link $categoryId}.
Sets (overwrites) the id of the subcategory see {@link $id}.
public setId ( string $id ) : static |
$id |
string |
A translation key eg 'General_Overview'. |
Результат |
static |
|
setName()
публичный Метод
Sets (overwrites) the name see {@link $name} and {@link $id}.
public setName ( string $name ) : static |
$name |
string |
A translation key eg 'General_Overview'. |
Результат |
static |
|
setOrder()
публичный Метод
Sets (overwrites) the order see {@link $order}.
Описание свойств
$categoryId защищенное свойство
See {@link Piwik\Widget\WidgetConfig::setCategoryId()`} or {@link Piwik\Report\getCategoryId()}.
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 защищенное свойство
The name that shall be used in the menu etc, defaults to the specified {@link $id}. See {@link $id}.
protected string $name |
Результат |
string |
|
$order защищенное свойство
The order of the subcategory. The lower the value the earlier a widget or a report will be displayed.
protected int $order |
Результат |
integer |
|