Widget extends ConfigurableModel
Class Widget
Table of Contents
Constants
- ATTRIBUTE_SLICE_DELIMITER = '__'
Methods
- __call() : void
- Implement delete and add actions for nested relations.
- __construct() : mixed
- Widget constructor.
- addConfigurationField() : void
- Build configuration entity from valuable $field and add to configurations list
- addConfigurations() : void
- addReportHandler() : void
- Attach report handler to widget handler.
- addReports() : void
- buildPseudoWidget() : Widget
- If parameter start with pseudo_ then create new widget.
- delete() : bool|null
- Delete widget if it is not pattern.
- deleteConfigurations() : void
- deletePatternWidget() : bool|null
- Delete pattern widget.
- deleteReports() : void
- deleteRow() : void
- factoryWithHorizontalCells() : mixed
- getBoardId() : string
- getCategoryKey() : string
- getChildWidgets() : array<string|int, Widget>
- getClassName() : string
- getConfigurations() : array<string|int, Configuration>
- getCopyForCurrentUser() : Widget
- Perform copy of widget with copies of nested relations.
- getCreatedAt() : DateTime
- getCurrentDbState() : array<string|int, mixed>
- getCurrentUserPatternedWidgets() : array<string|int, Widget>
- getCurrentUserWidgetByGId() : Widget
- Get current user widget by widget id with nested relations,
- getErrors() : array<string|int, mixed>
- Get Errors collections.
- getFilterId() : string
- construct and return filter name base on widget id.
- getGId() : mixed
- getId() : mixed
- getMapAttributes() : array<string|int, mixed>
- Returns the list of pair for mapping data and object properties.
- getMapReferenceAttributes() : array<string|int, mixed>
- Returns map of lazy loaded attributes of current model.
- getOwnerId() : int
- getParentWidget() : Widget
- getParentWidgetId() : mixed
- getReportByGId() : Report|null
- getReports() : array<string|int, Report>
- getReportsGidKeyed() : array<string|int, Report>
- Return report list, key in list get from gId.
- getRow() : DashboardRow
- getRowId() : mixed
- getTableClassName() : string
- Gets the fully qualified name of table class which belongs to current model.
- getUpdatedAt() : DateTime
- getViewKey() : string
- getWeight() : int
- getWidgetByGId() : Widget
- Load widget with nested relations by widget gId.
- getWidgetById() : static
- Load and return widget by widget id.
- getWidgetByIdWithReports() : Widget
- Load widget with nested relations by widget Id.
- getWidgetClass() : string
- getWidgetConfigurations() : array<string|int, Configuration>
- Load widget and get configurations of loaded widget.
- getWidgetHandler() : BaseWidget
- getWidgetsByBoard() : array<string|int, static>
- Get Widget by board id.
- isPattern() : bool
- load() : static
- loadAttribute() : void
- loadById() : static
- removeCurrentUserWidgetByGId() : bool
- Remove current user widget by gId.
- save() : Model
- setBoardId() : void
- Setter for board id.
- setCategoryKey() : void
- Attach widget to category.
- setConfigurations() : void
- Setter for Configuration colection.
- setCreatedAt() : void
- setGId() : void
- Setter for gId.
- setId() : void
- setIsPattern() : void
- Setter for pattern marker.
- setOwnerId() : void
- Attach widget to some user.
- setParentWidget() : void
- parent Widget entity.
- setParentWidgetId() : void
- Setter for parent widget id.
- setRow() : void
- Setter for row.
- setRowId() : void
- Setter for row id.
- setUpdatedAt() : void
- setViewKey() : void
- Setter for view key.
- setWeight() : void
- Setter for widget position.
- setWidgetClass() : void
- Widget handler class name.
- setWidgetHandler() : void
- Setter for widget handler.
Constants
ATTRIBUTE_SLICE_DELIMITER
public
mixed
ATTRIBUTE_SLICE_DELIMITER
= '__'
Methods
__call()
Implement delete and add actions for nested relations.
public
__call(string $name, array<string|int, mixed> $arguments) : void
Parameters
- $name : string
-
Getter name.
- $arguments : array<string|int, mixed>
-
Arguments passed to getter.
__construct()
Widget constructor.
public
__construct() : mixed
addConfigurationField()
Build configuration entity from valuable $field and add to configurations list
public
addConfigurationField(BaseValuable $field) : void
Parameters
- $field : BaseValuable
-
Field from create configuration.
addConfigurations()
public
addConfigurations(Configuration|array<string|int, Configuration> $configuration) : void
add configuration/configurations to this
Parameters
- $configuration : Configuration|array<string|int, Configuration>
addReportHandler()
Attach report handler to widget handler.
public
addReportHandler(BaseReport $reportHandler) : void
Parameters
- $reportHandler : BaseReport
-
Report handler.
addReports()
public
addReports(Report|array<string|int, Report> $report) : void
add report/reports to this widget.
Parameters
buildPseudoWidget()
If parameter start with pseudo_ then create new widget.
public
static buildPseudoWidget(array<string|int, mixed> $params) : Widget
Else try to load widget by gid, and change view key.
Parameters
- $params : array<string|int, mixed>
-
Parameters to build pseudo widget. [viewKey => 'number', widgetGId => 'pseudo_widget_gid'].
Return values
Widgetdelete()
Delete widget if it is not pattern.
public
delete() : bool|null
Return values
bool|nulldeleteConfigurations()
public
deleteConfigurations(Configuration|array<string|int, Configuration> $configuration) : void
delete connection with Configuration, but not delete Configuration object
Parameters
- $configuration : Configuration|array<string|int, Configuration>
deletePatternWidget()
Delete pattern widget.
public
deletePatternWidget() : bool|null
Return values
bool|nulldeleteReports()
public
deleteReports(Report|array<string|int, Report> $report) : void
delete report connection adn if it is ONE-TO-MANY delete Report entity.
Parameters
deleteRow()
public
deleteRow(DashboardRow $row) : void
delete report connection with row.
Parameters
- $row : DashboardRow
factoryWithHorizontalCells()
public
static factoryWithHorizontalCells([mixed $cellCount = 1 ]) : mixed
Parameters
- $cellCount : mixed = 1
getBoardId()
public
getBoardId() : string
Return values
stringgetCategoryKey()
public
getCategoryKey() : string
Return values
stringgetChildWidgets()
public
getChildWidgets() : array<string|int, Widget>
Return values
array<string|int, Widget>getClassName()
public
static getClassName() : string
Return values
stringgetConfigurations()
public
getConfigurations() : array<string|int, Configuration>
Return values
array<string|int, Configuration>getCopyForCurrentUser()
Perform copy of widget with copies of nested relations.
public
getCopyForCurrentUser() : Widget
Return values
WidgetgetCreatedAt()
public
getCreatedAt() : DateTime
Return values
DateTimegetCurrentDbState()
public
getCurrentDbState() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentUserPatternedWidgets()
public
static getCurrentUserPatternedWidgets() : array<string|int, Widget>
Return values
array<string|int, Widget>getCurrentUserWidgetByGId()
Get current user widget by widget id with nested relations,
public
static getCurrentUserWidgetByGId(string $widgetGId) : Widget
Parameters
- $widgetGId : string
-
Widget gId.
Return values
WidgetgetErrors()
Get Errors collections.
public
getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>getFilterId()
construct and return filter name base on widget id.
public
getFilterId() : string
Return values
stringgetGId()
public
getGId() : mixed
getId()
public
getId() : mixed
getMapAttributes()
Returns the list of pair for mapping data and object properties.
public
static getMapAttributes() : array<string|int, mixed>
Key is field in DataManager, value is object property.
Return values
array<string|int, mixed>getMapReferenceAttributes()
Returns map of lazy loaded attributes of current model.
public
static getMapReferenceAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getOwnerId()
public
getOwnerId() : int
Return values
intgetParentWidget()
public
getParentWidget() : Widget
Return values
WidgetgetParentWidgetId()
public
getParentWidgetId() : mixed
getReportByGId()
public
getReportByGId(string $reportGId) : Report|null
Parameters
- $reportGId : string
Return values
Report|nullgetReports()
public
getReports() : array<string|int, Report>
Return values
array<string|int, Report>getReportsGidKeyed()
Return report list, key in list get from gId.
public
getReportsGidKeyed() : array<string|int, Report>
Return values
array<string|int, Report>getRow()
public
getRow() : DashboardRow
Return values
DashboardRowgetRowId()
public
getRowId() : mixed
getTableClassName()
Gets the fully qualified name of table class which belongs to current model.
public
static getTableClassName() : string
Return values
stringgetUpdatedAt()
public
getUpdatedAt() : DateTime
Return values
DateTimegetViewKey()
public
getViewKey() : string
Return values
stringgetWeight()
public
getWeight() : int
Return values
intgetWidgetByGId()
Load widget with nested relations by widget gId.
public
static getWidgetByGId(string $widgetGId) : Widget
Parameters
- $widgetGId : string
-
Widget gId.
Return values
WidgetgetWidgetById()
Load and return widget by widget id.
public
static getWidgetById(string $widgetId) : static
Parameters
- $widgetId : string
-
Widget id.
Return values
staticgetWidgetByIdWithReports()
Load widget with nested relations by widget Id.
public
static getWidgetByIdWithReports(string $widgetId) : Widget
Parameters
- $widgetId : string
-
Widget id.
Return values
WidgetgetWidgetClass()
public
getWidgetClass() : string
Return values
stringgetWidgetConfigurations()
Load widget and get configurations of loaded widget.
public
static getWidgetConfigurations(string $widgetId) : array<string|int, Configuration>
Parameters
- $widgetId : string
-
Widget.
Return values
array<string|int, Configuration>getWidgetHandler()
public
getWidgetHandler([bool $isRuntime = false ]) : BaseWidget
Parameters
- $isRuntime : bool = false
Return values
BaseWidgetgetWidgetsByBoard()
Get Widget by board id.
public
static getWidgetsByBoard(string $boardId) : array<string|int, static>
Load all nested relation.
Parameters
- $boardId : string
-
Board id.
Return values
array<string|int, static>isPattern()
public
isPattern() : bool
Return values
boolload()
public
static load(array<string|int, mixed>|ConditionTree $filter[, array<string|int, mixed> $with = array() ][, array<string|int, mixed> $order = array() ]) : static
Parameters
- $filter : array<string|int, mixed>|ConditionTree
-
Filter parameters.
- $with : array<string|int, mixed> = array()
-
Relation keys to load.
- $order : array<string|int, mixed> = array()
-
Order parameters.
Return values
staticloadAttribute()
public
loadAttribute(string $attributeName) : void
Parameters
- $attributeName : string
-
Attribute name to load to property from db.
loadById()
public
static loadById(mixed $id) : static
Parameters
- $id : mixed
-
Load entity by id.
Return values
staticremoveCurrentUserWidgetByGId()
Remove current user widget by gId.
public
static removeCurrentUserWidgetByGId(string $widgetGId) : bool
Parameters
- $widgetGId : string
-
Widget gId.
Return values
boolsave()
public
save() : Model
Return values
ModelsetBoardId()
Setter for board id.
public
setBoardId(string $boardId) : void
Parameters
- $boardId : string
-
Board id.
setCategoryKey()
Attach widget to category.
public
setCategoryKey(string $categoryKey) : void
Parameters
- $categoryKey : string
-
Category key.
Tags
setConfigurations()
Setter for Configuration colection.
public
setConfigurations(array<string|int, Configuration> $configurations) : void
Parameters
- $configurations : array<string|int, Configuration>
-
Configuration list.
setCreatedAt()
public
setCreatedAt(DateTime $createdAt) : void
Parameters
- $createdAt : DateTime
-
Record create time.
setGId()
Setter for gId.
public
setGId(mixed $gId) : void
Parameters
- $gId : mixed
-
Value of gId.
setId()
public
setId(mixed $id) : void
Parameters
- $id : mixed
-
Id property value.
setIsPattern()
Setter for pattern marker.
public
setIsPattern(bool $isPattern) : void
Parameters
- $isPattern : bool
-
Marker to set is pattern or not.
setOwnerId()
Attach widget to some user.
public
setOwnerId(int $ownerId) : void
Parameters
- $ownerId : int
-
User id.
setParentWidget()
parent Widget entity.
public
setParentWidget(Widget $parentWidget) : void
Parameters
- $parentWidget : Widget
-
Widget entity.
setParentWidgetId()
Setter for parent widget id.
public
setParentWidgetId(mixed $parentWidgetId) : void
Parameters
- $parentWidgetId : mixed
-
Parent widget id.
setRow()
Setter for row.
public
setRow(DashboardRow $row) : void
Parameters
- $row : DashboardRow
-
Row Entity where place widget.
setRowId()
Setter for row id.
public
setRowId(mixed $rowId) : void
Parameters
- $rowId : mixed
-
Value of row id.
setUpdatedAt()
public
setUpdatedAt(DateTime $updatedAt) : void
Parameters
- $updatedAt : DateTime
-
Record update time.
setViewKey()
Setter for view key.
public
setViewKey(string $viewKey) : void
Parameters
- $viewKey : string
-
View key.
setWeight()
Setter for widget position.
public
setWeight(string $weight) : void
Parameters
- $weight : string
-
Position of widget in row.
setWidgetClass()
Widget handler class name.
public
setWidgetClass(string $widgetClass) : void
Parameters
- $widgetClass : string
-
Widget handler class name.
Tags
setWidgetHandler()
Setter for widget handler.
public
setWidgetHandler(BaseWidget $widgetHandler) : void
Set class name and set widget handler.
Parameters
- $widgetHandler : BaseWidget
-
Widget handler.