Constants

DATA_SOURCE_REQUEST

DATA_SOURCE_REQUEST

DATA_SOURCE_OBJECT

DATA_SOURCE_OBJECT

Properties

$widgetId

$widgetId : string

Type

string

$height

$height : mixed

Type

mixed

$colors

$colors : array

Type

array

$baseUrl

$baseUrl : \Psr\Http\Message\UriInterface|string

The base URI.

Type

\Psr\Http\Message\UriInterface|string

$adminConfig

$adminConfig : \Charcoal\Admin\Config

Store a reference to the admin configuration.

Type

\Charcoal\Admin\Config

$type

$type : string

Type

string

$template

$template : string

Type

string

$ident

$ident : string

Type

string

$label

$label : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$lang

$lang : string

Type

string

$showLabel

$showLabel : boolean

Type

boolean

$showActions

$showActions : boolean

Type

boolean

$priority

$priority : integer

Type

integer

$dataSources

$dataSources : array

Extra data sources to merge when setting data on an entity.

Type

array

$dataSourceFilters

$dataSourceFilters : array

Associative array of source identifiers and options to apply when merging.

Type

array

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$dbRows

$dbRows : array

Type

array

$groupingType

$groupingType : string

The date grouping type can be "hour", "day" or "month".

Type

string

$dateFormat

$dateFormat : string

Type

string

$sqlDateFormat

$sqlDateFormat : string

Type

string

$startDate

$startDate : \DateTimeInterface

Type

\DateTimeInterface

$endDate

$endDate : \DateTimeInterface

Type

\DateTimeInterface

$dateInterval

$dateInterval : \DateInterval

Type

\DateInterval

Methods

height()

height() : mixed

Returns

mixed

colors()

colors() : array<mixed,string>

Returns

array<mixed,string>

defaultColors()

defaultColors() : array<mixed,string>

Returns

array<mixed,string>

categories()

categories() : array

Returns

array —

Categories structure.

seriesJson()

seriesJson() : string

Returns

string —

JSONified categories structure.

series()

series() : array

Returns

array —

Series structure.

categoriesJson()

categoriesJson() : string

Returns

string —

JSONified categories structure.

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Parameters

\Pimple\Container $container

Pimple DI container.

setTemplate()

setTemplate(string  $template) : \Charcoal\Admin\UiItemInterface

Parameters

string $template

The UI item's template (identifier).

Throws

\InvalidArgumentException

If the template identifier is not a string.

Returns

\Charcoal\Admin\UiItemInterface —

Chainable

template()

template() : string

Returns

string

setWidgetId()

setWidgetId(string  $widgetId) : \Charcoal\Admin\AdminWidget

Parameters

string $widgetId

The widget identifier.

Returns

\Charcoal\Admin\AdminWidget

Chainable

widgetId()

widgetId() : string

Returns

string

setType()

setType(string  $type) : \Charcoal\Admin\AdminWidget

Parameters

string $type

The widget type.

Throws

\InvalidArgumentException

If the argument is not a string.

Returns

\Charcoal\Admin\AdminWidget

Chainable

type()

type() : string

Returns

string

setIdent()

setIdent(string  $ident) : \Charcoal\Admin\AdminWidget

Parameters

string $ident

The widget ident.

Throws

\InvalidArgumentException

If the ident is not a string.

Returns

\Charcoal\Admin\AdminWidget

(Chainable)

ident()

ident() : string

Returns

string

setDataSources()

setDataSources(mixed  $sources) : \Charcoal\Admin\AdminWidget

Set extra data sources to merge when setting data on an entity.

Parameters

mixed $sources

One or more data source identifiers to merge data from. Pass NULL to reset the entity back to default sources. Pass FALSE, an empty string or array to disable extra sources.

Returns

\Charcoal\Admin\AdminWidget

Chainable

dataSources()

dataSources() : array<mixed,string>

Retrieve the extra data sources to merge when setting data on an entity.

Returns

array<mixed,string>

dataSourceFilter()

dataSourceFilter(string  $sourceIdent) : callable|null

Retrieve the callable filter for the given data source.

Parameters

string $sourceIdent

A data source identifier.

Throws

\InvalidArgumentException

If the data source is invalid.

Returns

callable|null —

Returns a callable variable.

setLabel()

setLabel(mixed  $label) : \Charcoal\Admin\AdminWidget

Parameters

mixed $label

The label.

Returns

\Charcoal\Admin\AdminWidget

Chainable

label()

label() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

actions()

actions() : array

Returns

array

setShowActions()

setShowActions(boolean  $show) : \Charcoal\Admin\AdminWidget

Parameters

boolean $show

The show actions flag.

Returns

\Charcoal\Admin\AdminWidget

Chainable

showActions()

showActions() : boolean

Returns

boolean

setShowLabel()

setShowLabel(boolean  $show) : \Charcoal\Admin\AdminWidget

Parameters

boolean $show

The show label flag.

Returns

\Charcoal\Admin\AdminWidget

Chainable

showLabel()

showLabel() : boolean

Returns

boolean

adminUrl()

adminUrl() : \Psr\Http\Message\UriInterface|string

Retrieve the base URI of the administration area.

Returns

\Psr\Http\Message\UriInterface|string

setBaseUrl()

setBaseUrl(\Psr\Http\Message\UriInterface|string  $uri) : self

Set the base URI of the application.

Parameters

\Psr\Http\Message\UriInterface|string $uri

The base URI.

Returns

self

baseUrl()

baseUrl() : \Psr\Http\Message\UriInterface|string

Retrieve the base URI of the application.

Returns

\Psr\Http\Message\UriInterface|string

setPriority()

setPriority(integer  $priority) : \Charcoal\Admin\AdminWidget

Parameters

integer $priority

The widget's sorting priority.

Returns

\Charcoal\Admin\AdminWidget

Chainable

priority()

priority() : integer

Returns

integer

setGroupingType()

setGroupingType(string  $type) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string $type

The group type.

Throws

\InvalidArgumentException

If the group type is not a valid type.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

groupingType()

groupingType() : string

Returns

string

setDateFormat()

setDateFormat(string  $format) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string $format

The date format.

Throws

\InvalidArgumentException

If the format argument is not a string.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

dateFormat()

dateFormat() : string

Returns

string

setSqlDateFormat()

setSqlDateFormat(string  $format) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string $format

The date format.

Throws

\InvalidArgumentException

If the format argument is not a string.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

sqlDateFormat()

sqlDateFormat() : string

Returns

string

setStartDate()

setStartDate(string|\DateTimeInterface  $ts) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string|\DateTimeInterface $ts

The start date.

Throws

\InvalidArgumentException

If the date is not a valid datetime format.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

startDate()

startDate() : \DateTimeInterface

Returns

\DateTimeInterface

setEndDate()

setEndDate(string|\DateTimeInterface  $ts) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string|\DateTimeInterface $ts

The end date.

Throws

\InvalidArgumentException

If the date is not a valid datetime format.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

endDate()

endDate() : \DateTimeInterface

Returns

\DateTimeInterface

setDateInterval()

setDateInterval(string|\DateInterval  $interval) : \Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Parameters

string|\DateInterval $interval

The date interval, between "categories".

Throws

\InvalidArgumentException

If the argument is not a string or an interval object.

Returns

\Charcoal\Admin\Widget\Graph\TimeGraphWidgetInterface

Chainable

dateInterval()

dateInterval() : \DateInterval

Returns

\DateInterval

setModelFactory()

setModelFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\AdminScript

Parameters

\Charcoal\Factory\FactoryInterface $factory

The factory used to create models.

Returns

\Charcoal\Admin\AdminScript

Chainable

modelFactory()

modelFactory() : \Charcoal\Factory\FactoryInterface

Returns

\Charcoal\Factory\FactoryInterface —

The model factory.

addDataSources()

addDataSources(mixed  $sourceIdent, mixed  $sourceFilter = null) : \Charcoal\Admin\AdminWidget

Set extra data sources to merge when setting data on an entity.

Parameters

mixed $sourceIdent

The data source identifier.

mixed $sourceFilter

Optional filter to apply to the source's data.

Throws

\InvalidArgumentException

If the data source is invalid.

Returns

\Charcoal\Admin\AdminWidget

Chainable

acceptedDataSources()

acceptedDataSources() : array<mixed,string>

Retrieve the available data sources (when setting data on an entity).

Returns

array<mixed,string>

defaultDataSources()

defaultDataSources() : array<mixed,string>

Retrieve the default data sources (when setting data on an entity).

Returns

array<mixed,string>

defaultDataSourceFilters()

defaultDataSourceFilters() : array

Retrieve the default data source filters (when setting data on an entity).

Returns

array

resolveDataSourceFilter()

resolveDataSourceFilter(mixed  $toResolve) : callable|null

Retrieve the default data source filters (when setting data on an entity).

Note: Adapted from \Slim\CallableResolver.

Parameters

mixed $toResolve

A callable used when merging data.

Returns

callable|null

mergeDataSources()

mergeDataSources(array|\Charcoal\Admin\ArrayInterface  $dataset = null) : \Charcoal\Admin\AdminWidget

Retrieve the available data sources (when setting data on an entity).

Parameters

array|\Charcoal\Admin\ArrayInterface $dataset

The entity data.

Returns

\Charcoal\Admin\AdminWidget

Chainable

dbRows()

dbRows() : array

Returns

array

fillRows()

fillRows(array  $rows) : array

Fill all rows with 0 value for all series, when it is unset.

Parameters

array $rows

The row structure to fill.

Returns

array

objType()

objType() : string

Returns

string

seriesOptions()

seriesOptions() : array

Returns

array

categoryFunction()

categoryFunction() : string

Returns

string