DEFAULT_ACTION_PRIORITY
DEFAULT_ACTION_PRIORITY
Default sorting priority for an action.
The table widget displays a collection in a tabular (table) format.
$adminConfig : \Charcoal\Admin\Config
Store a reference to the admin configuration.
setData(array $data) : \Charcoal\Admin\Widget\TableWidget
array | $data | The widget data. |
Chainable
properties() : array<mixed,\Charcoal\Admin\Widget\FormPropertyWidget>
Sets and returns properties
Manages which to display, and their order, as set in object metadata
setSortable(boolean $sortable) : \Charcoal\Admin\Widget\TableWidget
boolean | $sortable | The sortable flag. |
Chainable
setShowObjectActions(boolean $show) : \Charcoal\Admin\Widget\TableWidget
Show/hide the table's object actions.
boolean | $show | Show (TRUE) or hide (FALSE) the actions. |
Chainable
setObjectActions(array $actions) : \Charcoal\Admin\Widget\TableWidget
Set the table's object actions.
array | $actions | One or more actions. |
Chainable.
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.
array | $actions | Actions to resolve. |
Object actions.
setShowListActions(boolean $show) : \Charcoal\Admin\Widget\TableWidget
Show/hide the table's collection actions.
boolean | $show | Show (TRUE) or hide (FALSE) the actions. |
Chainable
paginationWidget() : \Charcoal\Admin\Widget\PaginationWidget
setShowTableHeader(boolean $show) : \Charcoal\Admin\Widget\TableWidget
boolean | $show | The show flag. |
Chainable
setShowTableHead(boolean $show) : \Charcoal\Admin\Widget\TableWidget
boolean | $show | The show flag. |
Chainable
setShowTableFoot(boolean $show) : \Charcoal\Admin\Widget\TableWidget
boolean | $show | The show flag. |
Chainable
setView(\Charcoal\View\ViewInterface|array $view) : \Charcoal\Admin\Ui\CollectionContainerInterface
\Charcoal\View\ViewInterface|array | $view | The view instance. |
Chainable
setCollectionLoader(\Charcoal\Loader\CollectionLoader $loader) : \Charcoal\Admin\Ui\CollectionContainerInterface
\Charcoal\Loader\CollectionLoader | $loader | The collection loader. |
Chainable
setObjType(string $objType) : \Charcoal\Admin\Ui\CollectionContainerInterface
string | $objType | The collection's object type. |
If provided argument is not of type 'string'.
Chainable
setCollectionIdent(string $collectionIdent) : \Charcoal\Admin\Ui\CollectionContainerInterface
Set the key for the collection structure to use.
string | $collectionIdent | The collection identifier. |
If the identifier argument is not a string.
Chainable
setCollectionConfig(mixed $config) : \Charcoal\Admin\Ui\CollectionContainerInterface
Replace the collection's configset with the given parameters.
mixed | $config | New collection config values. |
Chainable
setCollection(mixed $collection) : \Charcoal\Admin\Ui\CollectionContainerInterface
mixed | $collection | The collection. |
Chainable
setWidgetId(string $widgetId) : \Charcoal\Admin\AdminWidget
string | $widgetId | The widget identifier. |
Chainable
setType(string $type) : \Charcoal\Admin\AdminWidget
string | $type | The widget type. |
If the argument is not a string.
Chainable
setIdent(string $ident) : \Charcoal\Admin\AdminWidget
string | $ident | The widget ident. |
If the ident is not a string.
(Chainable)
setDataSources(mixed $sources) : \Charcoal\Admin\AdminWidget
Set extra data sources to merge when setting data on an entity.
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. |
Chainable
dataSourceFilter(string $sourceIdent) : callable|null
Retrieve the callable filter for the given data source.
string | $sourceIdent | A data source identifier. |
If the data source is invalid.
Returns a callable variable.
setLabel(mixed $label) : \Charcoal\Admin\AdminWidget
mixed | $label | The label. |
Chainable
setShowActions(boolean $show) : \Charcoal\Admin\AdminWidget
boolean | $show | The show actions flag. |
Chainable
setShowLabel(boolean $show) : \Charcoal\Admin\AdminWidget
boolean | $show | The show label flag. |
Chainable
setPriority(integer $priority) : \Charcoal\Admin\AdminWidget
integer | $priority | The widget's sorting priority. |
Chainable
setPropertyFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Admin\Widget\TableWidget
\Charcoal\Factory\FactoryInterface | $factory | The property factory, to create properties. |
Chainable
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.
\Charcoal\Model\ModelInterface | $object | The current row's object. |
\Charcoal\Property\PropertyInterface | $property | The current property. |
string | $propertyValue | The property $key's display value. |
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.
\Charcoal\Property\PropertyInterface | $property | The current property. |
\Charcoal\Model\ModelInterface|null | $object | Optional. The current row's object. |
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.
\Charcoal\Model\ModelInterface | $object | The current row's object. |
array | $objectProperties | The $object's display properties. |
setListActions(array $actions) : \Charcoal\Admin\Widget\TableWidget
Set the table's collection actions.
array | $actions | One or more actions. |
Chainable.
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.
array | $actions | Actions to resolve. |
List actions.
setModelFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Admin\AdminScript
\Charcoal\Factory\FactoryInterface | $factory | The factory used to create models. |
Chainable
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.
\Charcoal\Model\ModelInterface | $object | The current row's object. |
\Charcoal\Property\PropertyInterface | $property | The current property. |
addDataSources(mixed $sourceIdent, mixed $sourceFilter = null) : \Charcoal\Admin\AdminWidget
Set extra data sources to merge when setting data on an entity.
mixed | $sourceIdent | The data source identifier. |
mixed | $sourceFilter | Optional filter to apply to the source's data. |
If the data source is invalid.
Chainable
mergeDataSources(array|\Charcoal\Admin\ArrayInterface $dataset = null) : \Charcoal\Admin\AdminWidget
Retrieve the available data sources (when setting data on an entity).
array|\Charcoal\Admin\ArrayInterface | $dataset | The entity data. |
Chainable
setPropertyDisplayFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Admin\Ui\CollectionContainerInterface
\Charcoal\Factory\FactoryInterface | $factory | The property display factory. |
Chainable