Abstract Widget.

abstract class AbstractWidget

Properties summary

Type Property Description
protected $title
protected $description
protected $columns
protected $weight
protected $wrapper
protected $cache
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.
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.
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

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

string render (bool $forceRefresh = false)

Render widget.

Parameters

bool $forceRefresh

Return Value

string