Abstract Widget.

abstract class AbstractWidget

Properties summary

Type Property Description
protected $title
protected $description
protected $columns
protected $weight
protected $wrapper
protected $cache
protected $cachePerUser
protected $cacheExpiry
protected $requiredPermission

Methods summary

Return Type Method Name Description
string getId() Get widget id.
string getTitle() Get title.
string getDescription() Get description.
int getColumnSize() Get column size.
int getWeight() Get display sort weighting.
bool showWrapper() Get if panel wrapper should be shown.
bool isCachable() Get if widget allows caching.
bool isCachedPerUser() Get if widget requires caching per user.
int getCacheExpiry() Get cache expiry time.
string getRequiredPermission() Get required permission.
array getData() Get data method.
string generateOutput(array $data) Generate output.
array fetchData(bool $forceRefresh = false) Fetch data.
sanitizeData($data) -
string render(bool $forceRefresh = false) Render widget.

Details

string getId ()

Get widget id.

Returns the class name.

Return Value

string

string getTitle ()

Get title.

Return Value

string

string getDescription ()

Get description.

Return Value

string

int getColumnSize ()

Get column size.

Return Value

int

int getWeight ()

Get display sort weighting.

Return Value

int

bool showWrapper ()

Get if panel wrapper should be shown.

Return Value

bool

bool isCachable ()

Get if widget allows caching.

Return Value

bool

bool isCachedPerUser ()

Get if widget requires caching per user.

Return Value

bool

int getCacheExpiry ()

Get cache expiry time.

Return Value

int

string getRequiredPermission ()

Get required permission.

Return Value

string

abstract array getData ()

Get data method.

A widget should override this method.

Return Value

array

abstract string generateOutput (array $data)

Generate output.

A widget should override this method.

Parameters

array $data

Return Value

string

protected array fetchData (bool $forceRefresh = false)

Fetch data.

Parameters

bool $forceRefresh

Return Value

array

sanitizeData ($data)

Parameters

$data

string render (bool $forceRefresh = false)

Render widget.

Parameters

bool $forceRefresh

Return Value

string