Constants

DATA_SOURCE_REQUEST

DATA_SOURCE_REQUEST

DATA_SOURCE_OBJECT

DATA_SOURCE_OBJECT

Properties

$widgetId

$widgetId : string

Type

string

$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

$showTitle

$showTitle : boolean

Type

boolean

$showSubtitle

$showSubtitle : boolean

Type

boolean

$showDescription

$showDescription : boolean

Type

boolean

$showNotes

$showNotes : boolean

Type

boolean

$title

$title : string

Type

string

$subtitle

$subtitle : string

Type

string

$description

$description : string

Type

string

$notes

$notes : string

Type

string

Methods

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

setShowTitle()

setShowTitle(boolean  $show) : \Charcoal\Admin\Widget\TextWidget

Parameters

boolean $show

The show title flag.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

showTitle()

showTitle() : boolean

Returns

boolean

setShowSubtitle()

setShowSubtitle(boolean  $show) : \Charcoal\Admin\Widget\TextWidget

Parameters

boolean $show

The show subtitle flag.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

showSubtitle()

showSubtitle() : boolean

Returns

boolean

setShowDescription()

setShowDescription(boolean  $show) : \Charcoal\Admin\Widget\TextWidget

Parameters

boolean $show

The show description flag.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

showDescription()

showDescription() : boolean

Returns

boolean

setShowNotes()

setShowNotes(boolean  $show) : \Charcoal\Admin\Widget\TextWidget

Parameters

boolean $show

The "show notes" flag.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

showNotes()

showNotes() : boolean

Returns

boolean

setTitle()

setTitle(mixed  $title) : \Charcoal\Admin\Widget\TextWidget

Parameters

mixed $title

The text widget title.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

title()

title() : \Charcoal\Admin\Widget\Translation

Returns

\Charcoal\Admin\Widget\Translation

setSubtitle()

setSubtitle(mixed  $subtitle) : \Charcoal\Admin\Widget\TextWidget

Parameters

mixed $subtitle

The text widget subtitle.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

subtitle()

subtitle() : \Charcoal\Admin\Widget\Translation

Returns

\Charcoal\Admin\Widget\Translation

setDescription()

setDescription(mixed  $description) : \Charcoal\Admin\Widget\TextWidget

Parameters

mixed $description

The text widget description (main content).

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

description()

description() : \Charcoal\Admin\Widget\Translation

Returns

\Charcoal\Admin\Widget\Translation

setNotes()

setNotes(mixed  $notes) : \Charcoal\Admin\Widget\TextWidget

Parameters

mixed $notes

The text widget notes.

Returns

\Charcoal\Admin\Widget\TextWidget

Chainable

notes()

notes() : \Charcoal\Admin\Widget\Translation

Returns

\Charcoal\Admin\Widget\Translation

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