DATA_SOURCE_REQUEST
DATA_SOURCE_REQUEST
The quick form widget for editing objects on the go.
For submitting information to a web server.
The widget is a variant of \Charcoal\Ui\Form\AbstractForm.
$hiddenProperties : array
The form's hidden controls.
$adminConfig : \Charcoal\Admin\Config
Store a reference to the admin configuration.
formProperties() : array<mixed,\Charcoal\Admin\Widget\FormPropertyWidget>|\Charcoal\Admin\Widget\Generator
Yield the form's property controls.
formProperty(string $propertyIdent) : \Charcoal\Admin\Widget\FormPropertyWidget
Retrieve an object property as a form control.
string | $propertyIdent | An optional group to use. |
If the property identifier is not a string.
If a property data is invalid.
setFormData(array $data) : \Charcoal\Admin\Widget\ObjectFormWidget
Set the form's auxiliary data.
This method is called via \self::setData() if a "form_data" parameter is present on the HTTP request.
array | $data | Data. |
Chainable.
setObjType(string $objType) : \Charcoal\Admin\Ui\ObjectContainerInterface
Set the object type.
string | $objType | The object type. |
If provided argument is not of type 'string'.
Chainable
setObjId(string|\Charcoal\Admin\Ui\numeric $objId) : \Charcoal\Admin\Ui\ObjectContainerInterface
Set the object ID.
string|\Charcoal\Admin\Ui\numeric | $objId | The object ID to load. |
If provided argument is not of type 'scalar'.
Chainable
setObjBaseClass(string $objBaseClass) : \Charcoal\Admin\Ui\ObjectContainerInterface
string | $objBaseClass | The base class. |
If provided argument is not of type 'string'.
Chainable
createFormProperty(array $data = null) : \Charcoal\Admin\Widget\FormPropertyWidget
array | $data | Optional. The form property data to set. |
setSidebars(array $sidebars) : \Charcoal\Admin\Widget\FormWidget
array | $sidebars | The form sidebars. |
Chainable
addSidebar(string $sidebarIdent, array|\Charcoal\Admin\Ui\FormSidebarInterface $sidebar) : \Charcoal\Admin\Widget\FormWidget
string | $sidebarIdent | The sidebar identifier. |
array|\Charcoal\Admin\Ui\FormSidebarInterface | $sidebar | The sidebar data or object. |
If the ident is not a string or the sidebar is not valid.
Chainable
sidebars() : array<mixed,\Charcoal\Admin\Ui\FormSidebarInterface>|\Charcoal\Admin\Widget\Generator
addFormProperty(string $propertyIdent, array|\Charcoal\Admin\Widget\FormPropertyInterface $formProperty) : \Charcoal\Ui\Form\FormInterface
Add a property control to the form.
If a given property uses a hidden form control, the form property will be added to \FormWidget::$hiddenProperties.
string | $propertyIdent | The property identifier. |
array|\Charcoal\Admin\Widget\FormPropertyInterface | $formProperty | The property object or structure. |
If the identifier or the property is invalid.
Chainable
addHiddenProperty(string $propertyIdent, array|\Charcoal\Admin\Widget\FormPropertyInterface $formProperty) : \Charcoal\Ui\Form\FormInterface
Add a hidden property control to the form.
string | $propertyIdent | The property identifier. |
array|\Charcoal\Admin\Widget\FormPropertyInterface | $formProperty | The property object or structure. |
If the identifier or the property is invalid.
Chainable
hiddenProperties() : array<mixed,\Charcoal\Admin\Widget\FormPropertyWidget>|\Charcoal\Admin\Widget\Generator
Yield the form's hidden property controls.
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
updateFormGroup(\Charcoal\Ui\FormGroup\FormGroupInterface $group, array|null $groupData = null, string|null $groupIdent = null) : \Charcoal\Ui\FormGroup\FormGroupInterface
Update the given form group widget.
\Charcoal\Ui\FormGroup\FormGroupInterface | $group | The form group to update. |
array|null | $groupData | Optional. The new group data to apply. |
string|null | $groupIdent | Optional. The new group identifier. |
setModelFactory(\Charcoal\Factory\FactoryInterface $factory) : \Charcoal\Admin\AdminScript
\Charcoal\Factory\FactoryInterface | $factory | The factory used to create models. |
Chainable
sortSidebarsByPriority(\Charcoal\Admin\Ui\FormSidebarInterface $a, \Charcoal\Admin\Ui\FormSidebarInterface $b) : integer
To be called with uasort().
\Charcoal\Admin\Ui\FormSidebarInterface | $a | Item "a" to compare, for sorting. |
\Charcoal\Admin\Ui\FormSidebarInterface | $b | Item "b" to compaer, for sorting. |
Sorting value: -1, 0, or 1
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