CSDashboardTile
in package
This class is part of the Dashboard module.
Tags
Table of Contents
- $_oTileRecord : mixed
- createTile() : CSDashboardTile
- This method is used to create a new tile.
- delete() : mixed
- This method deletes the current tile and all it's parameters from the database.
- deleteParameter() : mixed
- This method is used to delete a specific tile parameter by name for all users or only the passed user id.
- getApp() : string
- This method is used to return the app name of the dashboard tile.
- getAppScreen() : string
- This method is used to return the app screen name of the dashboard tile.
- getCategory() : string
- This method is used to get the tile categories for given user.
- getChangeable() : bool
- This method is used to return whether the dashboard tile is changeable by a user or not.
- getDashboardID() : int
- This method is used to return the id of the dashboard.
- getID() : int
- This method is used to return the id of the dashboard tile.
- getParameter() : CSDashboardTileParameter
- This method is used to get a tile parameter by its name. If a user id is passed then the value will be only searched within this user ids context. Otherwise the parameter will be searched for all users.
- getParameters() : array<string|int, mixed>
- This method is used to get the tile parameters. If a user id is passed then the values will be only searched within this user ids context. Otherwise the parameters will be searched for all users.
- getTile() : CSDashboardTile
- This method is used to get an existing tile.
- getUserID() : int
- This method is used to return the user id of the dashboard tile.
- setApp() : mixed
- This method is used to set the app name of the dashboard tile.
- setAppScreen() : mixed
- This method is used to set the app screen name of the dashboard tile.
- setCategory() : mixed
- This method is used to set categories for tile.
- setChangeable() : mixed
- This method is used to set whether the dashboard tile is changeable by a user or not.
- setParameter() : mixed
- This method is used to set a tile parameter.
- setParameters() : array<string|int, mixed>
- This method is used to set multiple tile parameters by passing an array in which the key is the parameters name and the value is the parameters value. Optionaly a user id can be passed to set the parameter only for a particular user.
- setUserID() : mixed
- This method is used to set the user id of the dashboard tile.
- store() : int
- This method is used to store the tile in the database.
- toArray() : array<string|int, mixed>
- This method returns an array with the most used tile settings.
- updateParameter() : mixed
- This method is used to update a tile parameter.
Properties
$_oTileRecord
public
mixed
$_oTileRecord
= \null
Tags
Methods
createTile()
This method is used to create a new tile.
public
static createTile(int $iDashboardId) : CSDashboardTile
Parameters
- $iDashboardId : int
-
the id of the dashboard on which the tile should be created
Tags
Return values
CSDashboardTile —a object of the newly created tile
delete()
This method deletes the current tile and all it's parameters from the database.
public
delete() : mixed
Tags
Return values
mixed —deleteParameter()
This method is used to delete a specific tile parameter by name for all users or only the passed user id.
public
deleteParameter(string $sName[, int $iUserId = null ]) : mixed
Parameters
- $sName : string
-
The name of the parameter which should be deleted
- $iUserId : int = null
-
The user id for which the parameter should be deleted, if not passed the parameter will be deleted for all users.
Tags
Return values
mixed —getApp()
This method is used to return the app name of the dashboard tile.
public
getApp() : string
Tags
Return values
string —getAppScreen()
This method is used to return the app screen name of the dashboard tile.
public
getAppScreen() : string
Tags
Return values
string —getCategory()
This method is used to get the tile categories for given user.
public
getCategory(int $iUserID[, bool $bGetTranslatedValue = true ]) : string
Parameters
- $iUserID : int
-
user id for which category is required
- $bGetTranslatedValue : bool = true
-
If translated value is required or not,default is true.
Tags
Return values
string —$sTileCategories returns the categories in ("Category1,Category2") format
getChangeable()
This method is used to return whether the dashboard tile is changeable by a user or not.
public
getChangeable() : bool
Tags
Return values
bool —getDashboardID()
This method is used to return the id of the dashboard.
public
getDashboardID() : int
Tags
Return values
int —getID()
This method is used to return the id of the dashboard tile.
public
getID() : int
Tags
Return values
int —getParameter()
This method is used to get a tile parameter by its name. If a user id is passed then the value will be only searched within this user ids context. Otherwise the parameter will be searched for all users.
public
getParameter(string $sName[, int $iUserId = null ]) : CSDashboardTileParameter
The first found parameter will be returned as a CSDashboardTileParameter object, if no parameter is found for the passed name then null will be returned.
Parameters
- $sName : string
-
the name of the parameter
- $iUserId : int = null
-
the id of the user for which the parameter should be returned
Tags
Return values
CSDashboardTileParameter —getParameters()
This method is used to get the tile parameters. If a user id is passed then the values will be only searched within this user ids context. Otherwise the parameters will be searched for all users.
public
getParameters([int $iUserId = null ]) : array<string|int, mixed>
Parameters
- $iUserId : int = null
-
the id of the user for which the parameter should be returned
Tags
Return values
array<string|int, mixed> —a array of CSDashboardTileParameter objects
getTile()
This method is used to get an existing tile.
public
static getTile(int $iTileId) : CSDashboardTile
Parameters
- $iTileId : int
-
the id of the tile
Tags
Return values
CSDashboardTile —a object of the requested tile
getUserID()
This method is used to return the user id of the dashboard tile.
public
getUserID() : int
Tags
Return values
int —setApp()
This method is used to set the app name of the dashboard tile.
public
setApp(string $sApp) : mixed
Parameters
- $sApp : string
-
the app name for the tile
Tags
Return values
mixed —setAppScreen()
This method is used to set the app screen name of the dashboard tile.
public
setAppScreen(mixed $sAppScreen) : mixed
Parameters
- $sAppScreen : mixed
Tags
Return values
mixed —setCategory()
This method is used to set categories for tile.
public
setCategory(string $sCategory, int $iUserId) : mixed
Parameters
- $sCategory : string
-
Category value to be set.
- $iUserId : int
-
The user id of the user for which the category should be set.
Tags
Return values
mixed —setChangeable()
This method is used to set whether the dashboard tile is changeable by a user or not.
public
setChangeable(int $iChangeable) : mixed
Parameters
- $iChangeable : int
-
0 or 1. whether the dashboard tile is changeable by a user or not
Tags
Return values
mixed —setParameter()
This method is used to set a tile parameter.
public
setParameter(string $sName, string $mValue, interger $iUserId) : mixed
Parameters
- $sName : string
-
The name of the parameter
- $mValue : string
-
The value of the parameter
- $iUserId : interger
-
The user id of the user for which the parameter should be set
Tags
Return values
mixed —setParameters()
This method is used to set multiple tile parameters by passing an array in which the key is the parameters name and the value is the parameters value. Optionaly a user id can be passed to set the parameter only for a particular user.
public
setParameters(array<string|int, mixed> $aParameters, int $iUserId) : array<string|int, mixed>
Parameters
- $aParameters : array<string|int, mixed>
-
The array of parameters
- $iUserId : int
-
The user id of the user for which the parameter should be set
Tags
Return values
array<string|int, mixed> —the passed $aParameters
setUserID()
This method is used to set the user id of the dashboard tile.
public
setUserID(int $iUserID) : mixed
Parameters
- $iUserID : int
-
the user id of the tiles creator
Tags
Return values
mixed —store()
This method is used to store the tile in the database.
public
store(int $iUserId) : int
Be aware that with calling the store method also all tile parameters are deleted from the database!
Parameters
- $iUserId : int
-
The user id of the current dashboard user
Tags
Return values
int —the id of the updated or created record
toArray()
This method returns an array with the most used tile settings.
public
toArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —array( 'DashboardTileID' => integer, 'DashboardID' => integer, 'UserID' => integer, 'App' => string, 'AppScreen' => string, 'Changeable' => integer )
updateParameter()
This method is used to update a tile parameter.
public
updateParameter(string $sName, string $mValue, interger $iUserId) : mixed
Parameters
- $sName : string
-
The name of the parameter
- $mValue : string
-
The value of the parameter
- $iUserId : interger
-
The user id of the user for which the parameter should be set
