StatisticsOverviewWidgetDefinitionProvider
in package
Class representing a service for collecting and providing all available widget.
This class acts as a registry which provides a convenient function to register a new widget. The registered widget can either be retrieved by its ID. You can also return a series of widgets with the same category.
Table of Contents
- $definitions : array<string|int, WidgetDefinition>
- Registered widgets.
- $factory : StatisticsOverviewFactory
- Factory.
- __construct() : mixed
- Constructor.
- getByCategory() : WidgetDefinitions
- Return widget definitions by category.
- getById() : WidgetDefinition
- Return widget definition by ID.
- register() : void
- Register widget definition.
Properties
$definitions
Registered widgets.
private
array<string|int, WidgetDefinition>
$definitions
$factory
Factory.
private
StatisticsOverviewFactory
$factory
Methods
__construct()
Constructor.
public
__construct(StatisticsOverviewFactory $factory) : mixed
Parameters
- $factory : StatisticsOverviewFactory
-
Factory.
Return values
mixed —getByCategory()
Return widget definitions by category.
public
getByCategory(WidgetCategory $category) : WidgetDefinitions
Parameters
- $category : WidgetCategory
-
Widget category.
Return values
WidgetDefinitions —All widgets found for the provided category.
getById()
Return widget definition by ID.
public
getById(WidgetId $id) : WidgetDefinition
Use this method to retrieve a specific widget.
Parameters
- $id : WidgetId
-
Widget ID.
Return values
WidgetDefinition —Widget with the provided ID.
register()
Register widget definition.
public
register(WidgetDefinition $widget) : void
Use this method to add your widget to the registry.
Parameters
- $widget : WidgetDefinition
-
Widget.