PHP Класс Piwik\Plugins\Dashboard\Model

Наследование: implements Piwik\Db\FactoryCreated
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( )
createNewDashboardForUser ( $login, $name, $layout ) Creates a new dashboard for the current user User needs to be logged in
createOrUpdateDashboard ( $login, $idDashboard, $layout ) Saves the layout as default
deleteAllLayoutsForUser ( $userLogin )
deleteDashboardForUser ( $idDashboard, $login ) Removes the dashboard with the given id
getAllDashboardsForUser ( $login )
getLayoutForUser ( string $login, integer $idDashboard ) : boolean | string Returns the layout in the DB for the given user, or false if the layout has not been set yet.
install ( )
replaceDashboardWidgets ( $dashboardLayout, array $oldWidgets, array $newWidgets ) Replaces widgets on the given dashboard layout with other ones
uninstall ( )
updateDashboardName ( string $login, integer $idDashboard, string $name ) Updates the name of a dashboard
updateLayoutForUser ( string $login, integer $idDashboard, string $layout ) Records the layout in the DB for the given user.

Защищенные методы

Метод Описание
layoutContainsWidget ( $dashboardLayout, $widgetId ) : boolean Checks if a given dashboard layout contains a given widget

Приватные методы

Метод Описание
getNextIdDashboard ( $login )

Описание методов

__construct() публичный Метод

public __construct ( )

createNewDashboardForUser() публичный Метод

Creates a new dashboard for the current user User needs to be logged in
public createNewDashboardForUser ( $login, $name, $layout )

createOrUpdateDashboard() публичный Метод

Saves the layout as default
public createOrUpdateDashboard ( $login, $idDashboard, $layout )

deleteAllLayoutsForUser() публичный Метод

public deleteAllLayoutsForUser ( $userLogin )

deleteDashboardForUser() публичный Метод

Removes the dashboard with the given id
public deleteDashboardForUser ( $idDashboard, $login )

getAllDashboardsForUser() публичный Метод

public getAllDashboardsForUser ( $login )

getLayoutForUser() публичный Метод

Parameters must be checked BEFORE this function call
public getLayoutForUser ( string $login, integer $idDashboard ) : boolean | string
$login string
$idDashboard integer
Результат boolean | string

install() публичный статический Метод

public static install ( )

layoutContainsWidget() защищенный статический Метод

Checks if a given dashboard layout contains a given widget
protected static layoutContainsWidget ( $dashboardLayout, $widgetId ) : boolean
$dashboardLayout
$widgetId
Результат boolean

replaceDashboardWidgets() публичный статический Метод

It uses the given widget definitions to find the old and to create the new widgets Each widget is defined with an array containing the following information array ( 'module' => string 'action' => string 'params' => array() ) if $newWidget does not contain a widget definition at the current position, the old widget will simply be removed
public static replaceDashboardWidgets ( $dashboardLayout, array $oldWidgets, array $newWidgets )
$oldWidgets array array containing widget definitions
$newWidgets array array containing widget definitions

uninstall() публичный статический Метод

public static uninstall ( )

updateDashboardName() публичный Метод

Updates the name of a dashboard
public updateDashboardName ( string $login, integer $idDashboard, string $name )
$login string
$idDashboard integer
$name string

updateLayoutForUser() публичный Метод

Records the layout in the DB for the given user.
public updateLayoutForUser ( string $login, integer $idDashboard, string $layout )
$login string
$idDashboard integer
$layout string