Create a new ArrayChoiceList object
ArrayChoiceList
ArrayChoiceList
(array $array, string $iv, string $dv)
-
array
$array: list of unique_name => displayed_value
-
string
$iv: index in which the unique_name should be stored in the ChoiceList
-
string
$dv: index in which the displayed_value should be stored in the ChoiceList
append a special field (such as "Create new:") to the choicelist
This method is much simpler than the DB equivalent as we won't need to remember them.
void
append
(
array $values, [
Field $field =
''])
-
array
$values: list of values to be displayed
-
Field
$field: (optional) a field class object to be placed next to this entry, if possible
display the contents of the list
string
display
()
prepend a special field (such as "Create new:") to the choicelist
This method is much simpler than the DB equivalent as we won't need to remember them.
void
prepend
(
array $values, [
Field $field =
''])
-
array
$values: list of values to be displayed
-
Field
$field: (optional) a field class object to be placed next to this entry, if possible
determine whih values are selected and return them
mixed
selectedValue
(boolean $returnArray)
-
boolean
$returnArray: return an array of values
set the currently selected value
void
set
(string $value)
-
string
$value: new value to use as curretly selected
set which option in the selection list is the default option
void
setDefault
(string $val)
-
string
$val: default value to use
synchronise: but we have nothing to do as we are not attached to the db
(provided to give interface to normal Field database)
boolean
sync
()
display the contents of the list
string
text_dump
()
update the value of the list based on user data:
- if it is within the range of current values, then take the value
- if the field contains a new value (and is allowed to) then keep
an illegal value, mark as being changed, and wait until later for
the field to be updated
- if the field contains a new value (and is not allowed to) or an
out-of-range value, then flag as being invalid
void
update
(string $newval, array $data)
-
string
$newval: the (possibly) new value for the field
-
array
$data: ancillary user data (passed on to any appended or prepended fields)
Construct an array suitable for storing the field and the values it takes for later reuse
void
_mkaddedarray
(
array $values, [
Field $field =
''])
-
array
$values: list of values to be displayed
-
Field
$field: Field object associated with these values
generate name=value pairs in case someone actually wants them!
string
_sqlvals
()