TDBCombo
extends TCombo
in package
Uses
AdiantiDatabaseWidgetTrait
Database ComboBox Widget
Tags
Table of Contents
Properties
- $changeFunction : mixed
- $editable : mixed
- $formName : mixed
- $id : mixed
- $is_boolean : mixed
- $items : mixed
- $label : mixed
- $name : mixed
- $properties : mixed
- $size : mixed
- $tag : mixed
- $value : mixed
- $valueCallback : mixed
- $changeAction : mixed
- $defaultOption : mixed
- $searchable : mixed
- $validations : mixed
Methods
- __call() : mixed
- Redirects function call
- __clone() : mixed
- Clone the object
- __construct() : mixed
- Class Constructor
- __get() : mixed
- Returns a property value
- __isset() : mixed
- Returns if the property is set
- __set() : mixed
- Intercepts whenever someones assign a new property's value
- __toString() : mixed
- Converts the object into a string
- addItems() : mixed
- Add items to the combo box
- addValidation() : mixed
- Add a field validator
- clear() : mixed
- Clear combo
- clearField() : mixed
- Clear the field
- disableField() : mixed
- Disable the field
- enableField() : mixed
- Enable the field
- enableSearch() : mixed
- Enable search
- getContents() : mixed
- Returns the element content as a string
- getEditable() : A
- Returns if the field is editable
- getFormName() : mixed
- Return the name of the form to wich the field is attached
- getId() : mixed
- Returns the field's id
- getItems() : mixed
- Return the combo items
- getItemsFromModel() : mixed
- Get items (key/value) from database to populate widget
- getLabel() : mixed
- Returns the field's label
- getName() : mixed
- Returns the field's name
- getObjectsFromModel() : mixed
- Get objects from database to populate widget
- getPostData() : mixed
- Return the post data
- getPropertiesAsString() : mixed
- Get properties as string
- getProperty() : mixed
- Return a field property
- getSize() : mixed
- Returns the field size
- getValidations() : mixed
- Returns field validations
- getValue() : mixed
- Returns the field's value
- isRequired() : mixed
- Returns if the field is required
- reload() : mixed
- Reload combobox items after it is already shown
- reloadFromModel() : mixed
- Reload combo from model data
- renderItems() : mixed
- Render items
- setBooleanMode() : mixed
- Enable/disable boolean mode
- setChangeAction() : mixed
- Define the action to be executed when the user changes the combo
- setChangeFunction() : mixed
- Set change function
- setDefaultOption() : mixed
- Define the combo default option value
- setEditable() : mixed
- Define if the field is editable
- setFormName() : mixed
- Define the name of the form to wich the field is attached
- setId() : mixed
- Define the field's id
- setLabel() : mixed
- Define the field's label
- setName() : mixed
- Define the field's name
- setProperty() : mixed
- Define a field property
- setSize() : mixed
- Define the Field's width
- setTagName() : mixed
- Change input tag name
- setTip() : mixed
- Define the field's tooltip
- setValue() : mixed
- Define the field's value
- setValueCallback() : mixed
- Set callback for setValue method
- show() : mixed
- Shows the widget
- validate() : mixed
- Validate a field
Properties
$changeFunction
protected
mixed
$changeFunction
$editable
protected
mixed
$editable
$formName
protected
mixed
$formName
$id
protected
mixed
$id
$is_boolean
protected
mixed
$is_boolean
$items
protected
mixed
$items
$label
protected
mixed
$label
$name
protected
mixed
$name
$properties
protected
mixed
$properties
$size
protected
mixed
$size
$tag
protected
mixed
$tag
$value
protected
mixed
$value
$valueCallback
protected
mixed
$valueCallback
$changeAction
private
mixed
$changeAction
$defaultOption
private
mixed
$defaultOption
$searchable
private
mixed
$searchable
$validations
private
mixed
$validations
Methods
__call()
Redirects function call
public
__call( $method, $param) : mixed
Parameters
__clone()
Clone the object
public
__clone() : mixed
__construct()
Class Constructor
public
__construct( $name, $database, $model, $key, $value[, $ordercolumn = NULL ][, $criteria = NULL ]) : mixed
Parameters
- $name :
-
widget's name
- $database :
-
database name
- $model :
-
model class name
- $key :
-
table field to be used as key in the combo
- $value :
-
table field to be listed in the combo
- $ordercolumn : = NULL
-
column to order the fields (optional)
- $criteria : = NULL
-
criteria (TCriteria object) to filter the model (optional)
__get()
Returns a property value
public
__get( $name) : mixed
Parameters
__isset()
Returns if the property is set
public
__isset( $name) : mixed
Parameters
__set()
Intercepts whenever someones assign a new property's value
public
__set( $name, $value) : mixed
Parameters
__toString()
Converts the object into a string
public
__toString() : mixed
addItems()
Add items to the combo box
public
addItems( $items) : mixed
Parameters
addValidation()
Add a field validator
public
addValidation( $label, $validator[, $parameters = NULL ]) : mixed
Parameters
clear()
Clear combo
public
clear() : mixed
clearField()
Clear the field
public
static clearField( $form_name, $field) : mixed
Parameters
disableField()
Disable the field
public
static disableField( $form_name, $field) : mixed
Parameters
enableField()
Enable the field
public
static enableField( $form_name, $field) : mixed
Parameters
enableSearch()
Enable search
public
enableSearch() : mixed
getContents()
Returns the element content as a string
public
getContents() : mixed
getEditable()
Returns if the field is editable
public
getEditable() : A
Return values
A —boolean
getFormName()
Return the name of the form to wich the field is attached
public
getFormName() : mixed
getId()
Returns the field's id
public
getId() : mixed
getItems()
Return the combo items
public
getItems() : mixed
getItemsFromModel()
Get items (key/value) from database to populate widget
public
static getItemsFromModel(mixed $database, mixed $model, mixed $key, mixed $value[, mixed $ordercolumn = NULL ][, TCriteria $criteria = NULL ]) : mixed
Parameters
- $database : mixed
- $model : mixed
- $key : mixed
- $value : mixed
- $ordercolumn : mixed = NULL
- $criteria : TCriteria = NULL
getLabel()
Returns the field's label
public
getLabel() : mixed
getName()
Returns the field's name
public
getName() : mixed
getObjectsFromModel()
Get objects from database to populate widget
public
static getObjectsFromModel(mixed $database, mixed $model, mixed $key[, mixed $ordercolumn = NULL ][, TCriteria $criteria = NULL ]) : mixed
Parameters
- $database : mixed
- $model : mixed
- $key : mixed
- $ordercolumn : mixed = NULL
- $criteria : TCriteria = NULL
getPostData()
Return the post data
public
getPostData() : mixed
getPropertiesAsString()
Get properties as string
public
getPropertiesAsString([mixed $filter = null ]) : mixed
Parameters
- $filter : mixed = null
getProperty()
Return a field property
public
getProperty( $name) : mixed
Parameters
getSize()
Returns the field size
public
getSize() : mixed
getValidations()
Returns field validations
public
getValidations() : mixed
getValue()
Returns the field's value
public
getValue() : mixed
isRequired()
Returns if the field is required
public
isRequired() : mixed
reload()
Reload combobox items after it is already shown
public
static reload( $formname, $name, $items[, $startEmpty = FALSE ][, $fire_events = TRUE ]) : mixed
Parameters
reloadFromModel()
Reload combo from model data
public
static reloadFromModel( $formname, $field, $database, $model, $key, $value[, $ordercolumn = NULL ][, $criteria = NULL ][, $startEmpty = FALSE ][, $fire_events = TRUE ]) : mixed
Parameters
- $formname :
-
form name
- $field :
-
field name
- $database :
-
database name
- $model :
-
model class name
- $key :
-
table field to be used as key in the combo
- $value :
-
table field to be listed in the combo
- $ordercolumn : = NULL
-
column to order the fields (optional)
- $criteria : = NULL
-
criteria (TCriteria object) to filter the model (optional)
- $startEmpty : = FALSE
-
if the combo will have an empty first item
- $fire_events : = TRUE
-
if change action will be fired
renderItems()
Render items
public
renderItems() : mixed
setBooleanMode()
Enable/disable boolean mode
public
setBooleanMode() : mixed
setChangeAction()
Define the action to be executed when the user changes the combo
public
setChangeAction( $action) : mixed
Parameters
setChangeFunction()
Set change function
public
setChangeFunction(mixed $function) : mixed
Parameters
- $function : mixed
setDefaultOption()
Define the combo default option value
public
setDefaultOption( $option) : mixed
Parameters
setEditable()
Define if the field is editable
public
setEditable( $editable) : mixed
Parameters
setFormName()
Define the name of the form to wich the field is attached
public
setFormName( $name) : mixed
Parameters
Tags
setId()
Define the field's id
public
setId( $id) : mixed
Parameters
setLabel()
Define the field's label
public
setLabel( $label) : mixed
Parameters
setName()
Define the field's name
public
setName( $name) : mixed
Parameters
setProperty()
Define a field property
public
setProperty( $name, $value[, mixed $replace = TRUE ]) : mixed
Parameters
setSize()
Define the Field's width
public
setSize( $width[, mixed $height = NULL ]) : mixed
Parameters
setTagName()
Change input tag name
public
setTagName(mixed $name) : mixed
Parameters
- $name : mixed
setTip()
Define the field's tooltip
public
setTip(mixed $tip) : mixed
Parameters
- $tip : mixed
setValue()
Define the field's value
public
setValue( $value) : mixed
Parameters
setValueCallback()
Set callback for setValue method
public
setValueCallback(mixed $callback) : mixed
Parameters
- $callback : mixed
show()
Shows the widget
public
show() : mixed
validate()
Validate a field
public
validate() : mixed