\Charcoal\Admin\WidgetTableGridWidget

The table widget displays a collection in a tabular (table) format.

Summary

Methods
Properties
Constants
setDependencies()
propertyFactory()
setData()
dataFromRequest()
acceptedRequestData()
dataFromObject()
properties()
setSortable()
sortable()
propertiesOptions()
viewOptions()
collectionProperties()
setShowObjectActions()
showObjectActions()
objectActions()
setObjectActions()
createObjectActions()
showEmptyListActions()
emptyListActions()
setShowListActions()
showListActions()
listActions()
paginationWidget()
setShowTableHeader()
showTableHeader()
setShowTableHead()
showTableHead()
setShowTableFoot()
showTableFoot()
jsActionPrefix()
objectEditUrl()
objectCreateUrl()
isObjCreatable()
isObjEditable()
isObjDeletable()
isObjViewable()
setView()
view()
setCollectionLoader()
setObjType()
objType()
setCollectionIdent()
collectionIdentFallback()
collectionIdent()
collectionMetadata()
collectionConfig()
setCollectionConfig()
mergeCollectionConfig()
page()
numPerPage()
numPages()
setCollection()
collection()
createCollection()
objects()
sortObjects()
sortProperties()
objectRows()
hasObjects()
numObjects()
numTotal()
proto()
setTemplate()
template()
setWidgetId()
widgetId()
setType()
type()
setIdent()
ident()
setDataSources()
dataSources()
dataSourceFilter()
setLabel()
label()
actions()
setShowActions()
showActions()
setShowLabel()
showLabel()
adminUrl()
setBaseUrl()
baseUrl()
setPriority()
priority()
$widgetId
DEFAULT_ACTION_PRIORITY
DATA_SOURCE_REQUEST
DATA_SOURCE_OBJECT
setWidgetFactory()
widgetFactory()
setPropertyFactory()
resolveDataSourceFilter()
defaultPropertiesOptions()
parsePropertyCell()
parsePropertyCellClasses()
parseObjectRow()
parseAsObjectActions()
defaultObjectActions()
setListActions()
createListActions()
parseAsListActions()
defaultListActions()
setModelFactory()
modelFactory()
collectionLoader()
createCollectionLoader()
parseCollectionConfig()
defaultCollectionConfig()
createCollectionConfig()
setupDisplayPropertyValue()
addDataSources()
acceptedDataSources()
defaultDataSources()
defaultDataSourceFilters()
mergeDataSources()
$properties
$parsedProperties
$propertiesOptions
$sortable
$showTableHeader
$showTableHead
$showTableFoot
$listActions
$defaultListActions
$parsedListActions
$objectActions
$defaultObjectActions
$parsedObjectActions
$currentObjId
$currentObj
$display
$baseUrl
$adminConfig
N/A
setPropertyDisplayFactory()
propertyDisplayFactory()
$widgetFactory
$propertyFactory
$adminMetadata
$showListActions
$showObjectActions
$modelFactory
$collectionLoader
$objType
$collectionIdent
$collectionConfig
$defaultCollectionConfig
$numTotal
$collection
$propertyDisplayFactory
$proto
$view
$type
$template
$ident
$label
$lang
$showLabel
$showActions
$priority
$dataSources
$dataSourceFilters
N/A

Constants

DEFAULT_ACTION_PRIORITY

DEFAULT_ACTION_PRIORITY

Default sorting priority for an action.

DATA_SOURCE_REQUEST

DATA_SOURCE_REQUEST

DATA_SOURCE_OBJECT

DATA_SOURCE_OBJECT

Properties

$widgetId

$widgetId : string

Type

string

$properties

$properties : array

Type

array

$parsedProperties

$parsedProperties : boolean

Type

boolean

$propertiesOptions

$propertiesOptions : array

Type

array

$sortable

$sortable : boolean

Type

boolean

$showTableHeader

$showTableHeader : boolean

Type

boolean

$showTableHead

$showTableHead : boolean

Type

boolean

$showTableFoot

$showTableFoot : boolean

Type

boolean

$listActions

$listActions : array|null

Store the list actions.

Type

array|null

$defaultListActions

$defaultListActions : array|null

Store the default list actions.

Type

array|null

$parsedListActions

$parsedListActions : boolean

Keep track if list actions are finalized.

Type

boolean

$objectActions

$objectActions : array|null

Store the object actions.

Type

array|null

$defaultObjectActions

$defaultObjectActions : array|null

Store the default object actions.

Type

array|null

$parsedObjectActions

$parsedObjectActions : boolean

Keep track if object actions are finalized.

Type

boolean

$currentObjId

$currentObjId : mixed

Type

mixed

$currentObj

$currentObj : mixed

Type

mixed

$display

$display : \Charcoal\Admin\Ui\PropertyInputInterface

In memory copy of the PropertyDisplay object

Type

\Charcoal\Admin\Ui\PropertyInputInterface

$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

$widgetFactory

$widgetFactory : \Charcoal\Factory\FactoryInterface

Store the factory instance for the current class.

Type

\Charcoal\Factory\FactoryInterface

$propertyFactory

$propertyFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$adminMetadata

$adminMetadata : mixed

Type

mixed

$showListActions

$showListActions : boolean

List actions ars displayed by default.

Type

boolean

$showObjectActions

$showObjectActions : boolean

Object actions ars displayed by default.

Type

boolean

$modelFactory

$modelFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$collectionLoader

$collectionLoader : \Charcoal\Loader\CollectionLoader

Type

\Charcoal\Loader\CollectionLoader

$objType

$objType : string

Type

string

$collectionIdent

$collectionIdent : string

Type

string

$collectionConfig

$collectionConfig : array|null

Collection configuration.

Type

array|null

$defaultCollectionConfig

$defaultCollectionConfig : array|null

Default collection configuration.

Type

array|null

$numTotal

$numTotal : integer

Type

integer

$collection

$collection : \Charcoal\Model\Collection

Type

\Charcoal\Model\Collection

$propertyDisplayFactory

$propertyDisplayFactory : \Charcoal\Factory\FactoryInterface

Type

\Charcoal\Factory\FactoryInterface

$proto

$proto : \Charcoal\Model\ModelInterface

Type

\Charcoal\Model\ModelInterface

$view

$view : \Charcoal\View\ViewInterface

Type

\Charcoal\View\ViewInterface

$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

Methods

setDependencies()

setDependencies(\Pimple\Container  $container) : void

Parameters

\Pimple\Container $container

Pimple DI container.

propertyFactory()

propertyFactory() : \Charcoal\Factory\FactoryInterface

Throws

\RuntimeException

If the property factory was not previously set / injected.

Returns

\Charcoal\Factory\FactoryInterface

dataFromRequest()

dataFromRequest() : array

Fetch metadata from the current request.

Returns

array

acceptedRequestData()

acceptedRequestData() : array

Retrieve the accepted metadata from the current request.

Returns

array

dataFromObject()

dataFromObject() : array

Fetch metadata from the current object type.

Returns

array

properties()

properties() : array<mixed,\Charcoal\Admin\Widget\FormPropertyWidget>

Sets and returns properties

Manages which to display, and their order, as set in object metadata

Returns

array<mixed,\Charcoal\Admin\Widget\FormPropertyWidget>

setSortable()

setSortable(boolean  $sortable) : \Charcoal\Admin\Widget\TableWidget

Parameters

boolean $sortable

The sortable flag.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

sortable()

sortable() : boolean

Returns

boolean

propertiesOptions()

propertiesOptions() : array|null

Retrieve the property customizations for the collection.

Returns

array|null

viewOptions()

viewOptions(string  $propertyIdent) : array

Retrieve the view options for the given property.

Parameters

string $propertyIdent

The property identifier to lookup.

Returns

array

collectionProperties()

collectionProperties() : array|\Charcoal\Admin\Widget\Generator

Properties to display in collection template, and their order, as set in object metadata

Returns

array|\Charcoal\Admin\Widget\Generator

setShowObjectActions()

setShowObjectActions(boolean  $show) : \Charcoal\Admin\Widget\TableWidget

Show/hide the table's object actions.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the actions.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

showObjectActions()

showObjectActions() : boolean

Determine if the table's object actions should be shown.

Returns

boolean

objectActions()

objectActions() : array

Retrieve the table's object actions.

Returns

array

setObjectActions()

setObjectActions(array  $actions) : \Charcoal\Admin\Widget\TableWidget

Set the table's object actions.

Parameters

array $actions

One or more actions.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable.

createObjectActions()

createObjectActions(array  $actions) : array

Build the table's object actions (row).

Object actions should come from the collection settings defined by the "collection_ident". It is still possible to completly override those externally by setting the "object_actions" with the \self::setObjectActions() method.

Parameters

array $actions

Actions to resolve.

Returns

array —

Object actions.

showEmptyListActions()

showEmptyListActions() : boolean

Determine if the table's empty collection actions should be shown.

Returns

boolean

emptyListActions()

emptyListActions() : array

Retrieve the table's empty collection actions.

Returns

array

setShowListActions()

setShowListActions(boolean  $show) : \Charcoal\Admin\Widget\TableWidget

Show/hide the table's collection actions.

Parameters

boolean $show

Show (TRUE) or hide (FALSE) the actions.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

showListActions()

showListActions() : boolean

Determine if the table's collection actions should be shown.

Returns

boolean

listActions()

listActions() : array

Retrieve the table's collection actions.

Returns

array

setShowTableHeader()

setShowTableHeader(boolean  $show) : \Charcoal\Admin\Widget\TableWidget

Parameters

boolean $show

The show flag.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

showTableHeader()

showTableHeader() : boolean

Returns

boolean

setShowTableHead()

setShowTableHead(boolean  $show) : \Charcoal\Admin\Widget\TableWidget

Parameters

boolean $show

The show flag.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

showTableHead()

showTableHead() : boolean

Returns

boolean

setShowTableFoot()

setShowTableFoot(boolean  $show) : \Charcoal\Admin\Widget\TableWidget

Parameters

boolean $show

The show flag.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

showTableFoot()

showTableFoot() : boolean

Returns

boolean

jsActionPrefix()

jsActionPrefix() : string

Returns

string

objectEditUrl()

objectEditUrl() : string

Generate URL for editing an object

Returns

string

objectCreateUrl()

objectCreateUrl() : string

Generate URL for creating an object

Returns

string

isObjCreatable()

isObjCreatable() : boolean

Determine if the object can be created.

If TRUE, the "Create" button is shown. Objects can still be inserted programmatically or via direct action on the database.

Returns

boolean

isObjEditable()

isObjEditable() : boolean

Determine if the object can be modified.

If TRUE, the "Modify" button is shown. Objects can still be updated programmatically or via direct action on the database.

Returns

boolean

isObjDeletable()

isObjDeletable() : boolean

Determine if the object can be deleted.

If TRUE, the "Delete" button is shown. Objects can still be deleted programmatically or via direct action on the database.

Returns

boolean

isObjViewable()

isObjViewable() : boolean

Determine if the object can be viewed (on the front-end).

If TRUE, any "View" button is shown. The object can still be saved programmatically.

Returns

boolean

setView()

setView(\Charcoal\View\ViewInterface|array  $view) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\View\ViewInterface|array $view

The view instance.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

view()

view() : \Charcoal\View\ViewInterface

Throws

\Exception

If the view instance is not previously set / injected.

Returns

\Charcoal\View\ViewInterface —

The object's view.

setCollectionLoader()

setCollectionLoader(\Charcoal\Loader\CollectionLoader  $loader) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\Loader\CollectionLoader $loader

The collection loader.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

setObjType()

setObjType(string  $objType) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

string $objType

The collection's object type.

Throws

\InvalidArgumentException

If provided argument is not of type 'string'.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

objType()

objType() : string

Returns

string

setCollectionIdent()

setCollectionIdent(string  $collectionIdent) : \Charcoal\Admin\Ui\CollectionContainerInterface

Set the key for the collection structure to use.

Parameters

string $collectionIdent

The collection identifier.

Throws

\InvalidArgumentException

If the identifier argument is not a string.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

collectionIdentFallback()

collectionIdentFallback() : string

Retrieve a key for the collection structure to use.

If the collection key is undefined, resolve a fallback.

Returns

string

collectionIdent()

collectionIdent() : string|null

Retrieve the key for the collection structure to use.

Returns

string|null

collectionMetadata()

collectionMetadata() : array

Return the current collection metadata.

Returns

array

collectionConfig()

collectionConfig() : array|null

Retrieve the collection configset.

Returns

array|null

setCollectionConfig()

setCollectionConfig(mixed  $config) : \Charcoal\Admin\Ui\CollectionContainerInterface

Replace the collection's configset with the given parameters.

Parameters

mixed $config

New collection config values.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

mergeCollectionConfig()

mergeCollectionConfig(array  $config) : self

Merge given parameters into the collection's configset.

Parameters

array $config

New collection config values.

Returns

self

page()

page() : integer

Returns

integer

numPerPage()

numPerPage() : integer

Returns

integer

numPages()

numPages() : integer

Returns

integer

collection()

collection() : \Charcoal\Model\Collection

Returns

\Charcoal\Model\Collection

createCollection()

createCollection(array  $data = null) : \Charcoal\Loader\CollectionLoader

Parameters

array $data

Optional collection data.

Throws

\Exception

If the object type of the colletion has not been set.

Returns

\Charcoal\Loader\CollectionLoader

objects()

objects() : array

Returns

array

sortObjects()

sortObjects() : array

Sort the objects before they are displayed as rows.

This method is useful for classes using this trait.

Returns

array

sortProperties()

sortProperties() : array

Sort the properties before they are displayed as columns.

This method is useful for classes using this trait.

Returns

array

objectRows()

objectRows() : array

Supplies properties for objects in table template specific to object configuration.

Returns

array —

This metod is a generator.

hasObjects()

hasObjects() : boolean

Returns

boolean

numObjects()

numObjects() : integer

Returns

integer

numTotal()

numTotal() : integer

Throws

\Exception

If obj type was not set.

Returns

integer

proto()

proto(boolean  $reload = false) : object

Parameters

boolean $reload

If true, reload will be forced.

Throws

\InvalidArgumentException

If the object type is not defined / can not create prototype.

Returns

object

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

setWidgetFactory()

setWidgetFactory(\Charcoal\Factory\FactoryInterface  $factory) : self

Set an widget factory.

Parameters

\Charcoal\Factory\FactoryInterface $factory

The factory to create widgets.

Returns

self

widgetFactory()

widgetFactory() : \Charcoal\Factory\FactoryInterface

Retrieve the widget factory.

Throws

\RuntimeException

If the widget factory was not previously set.

Returns

\Charcoal\Factory\FactoryInterface

setPropertyFactory()

setPropertyFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Widget\TableWidget

Parameters

\Charcoal\Factory\FactoryInterface $factory

The property factory, to create properties.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable

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

defaultPropertiesOptions()

defaultPropertiesOptions() : array|null

Retrieve the default property customizations.

The default configset is determined by the collection ident and object type, if assigned.

Returns

array|null

parsePropertyCell()

parsePropertyCell(\Charcoal\Model\ModelInterface  $object, \Charcoal\Property\PropertyInterface  $property, string  $propertyValue) : array

Filter the property before its assigned to the object row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

\Charcoal\Property\PropertyInterface $property

The current property.

string $propertyValue

The property $key's display value.

Returns

array

parsePropertyCellClasses()

parsePropertyCellClasses(\Charcoal\Property\PropertyInterface  $property, \Charcoal\Model\ModelInterface|null  $object = null) : array

Filter the table cell's CSS classes before the property is assigned to the object row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Property\PropertyInterface $property

The current property.

\Charcoal\Model\ModelInterface|null $object

Optional. The current row's object.

Returns

array

parseObjectRow()

parseObjectRow(\Charcoal\Model\ModelInterface  $object, array  $objectProperties) : array

Filter the object before its assigned to the row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

array $objectProperties

The $object's display properties.

Returns

array

parseAsObjectActions()

parseAsObjectActions(array  $actions) : array

Parse the given actions as (row) object actions.

Parameters

array $actions

Actions to resolve.

Returns

array

defaultObjectActions()

defaultObjectActions() : array

Retrieve the table's default object actions.

Returns

array

setListActions()

setListActions(array  $actions) : \Charcoal\Admin\Widget\TableWidget

Set the table's collection actions.

Parameters

array $actions

One or more actions.

Returns

\Charcoal\Admin\Widget\TableWidget

Chainable.

createListActions()

createListActions(array  $actions) : array

Build the table collection actions.

List actions should come from the collection settings defined by the "collection_ident". It is still possible to completly override those externally by setting the "list_actions" with the \self::setListActions() method.

Parameters

array $actions

Actions to resolve.

Returns

array —

List actions.

parseAsListActions()

parseAsListActions(array  $actions) : array

Parse the given actions as collection actions.

Parameters

array $actions

Actions to resolve.

Returns

array

defaultListActions()

defaultListActions() : array

Retrieve the table's default collection actions.

Returns

array

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.

collectionLoader()

collectionLoader() : \Charcoal\Loader\CollectionLoader

Safe Collection Loader getter.

Create the loader if it was not set / injected.

Returns

\Charcoal\Loader\CollectionLoader

createCollectionLoader()

createCollectionLoader() : \Charcoal\Loader\CollectionLoader

Create a collection loader.

Returns

\Charcoal\Loader\CollectionLoader

parseCollectionConfig()

parseCollectionConfig(array  $config) : array

Stub: Parse given parameters into the collection's config set.

Parameters

array $config

New collection config values.

Returns

array

defaultCollectionConfig()

defaultCollectionConfig() : array|null

Retrieve the default collection configuration.

The default configset is determined by the collection ident and object type, if assigned.

Returns

array|null

createCollectionConfig()

createCollectionConfig() : mixed

Stub: reimplement in classes using this trait.

Returns

mixed

setupDisplayPropertyValue()

setupDisplayPropertyValue(\Charcoal\Model\ModelInterface  $object, \Charcoal\Property\PropertyInterface  $property) : void

Setup the property's display value before its assigned to the object row.

This method is useful for classes using this trait.

Parameters

\Charcoal\Model\ModelInterface $object

The current row's object.

\Charcoal\Property\PropertyInterface $property

The current property.

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

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

setPropertyDisplayFactory()

setPropertyDisplayFactory(\Charcoal\Factory\FactoryInterface  $factory) : \Charcoal\Admin\Ui\CollectionContainerInterface

Parameters

\Charcoal\Factory\FactoryInterface $factory

The property display factory.

Returns

\Charcoal\Admin\Ui\CollectionContainerInterface

Chainable

propertyDisplayFactory()

propertyDisplayFactory() : \Charcoal\Factory\FactoryInterface

Throws

\Exception

If the property display factory was not previously injected / set.

Returns

\Charcoal\Factory\FactoryInterface