Field object that corresponds to one field in a SQL table row.
A number of fields would normally be held together in a DBRow, with the DBRow object controlling the updating to the SQL database.
Typical usage is through inheritance, see example for DBRow.
Located in /inc/formslib/field.php (line 36)
Class | Description |
---|---|
CheckBox | a checkbox object |
ChoiceList | a choice list field from which a select, list of hrefs etc can be built |
CommentField | a non-SQL active field (for the information of the user, not the database) |
DateTimeField | a textfield designed for date-time data |
DateField | textfield form widget designed to contain dates |
DummyField | a dummy field does not exist in the database but stores data in the form |
JoinMatrix | Similar to JoinData, but presents the options in a matrix not a list |
JoinData | an object that manages data related by an SQL JOIN but pretends to be a single form field. |
ReferenceField | a non-editable reference object to explain a table entry |
TextField | The textfield widget primitive |
TimeField | a textfield widget designed to handle time date |
Create a new generic field object, designed to be superclasses
render this form widget in an html table
Obtain the value of the field, taking account of default values
html representation of this field as a "hidden" form widget
Check the validity of the current data value.
This also checks the validity of the data even if the data is not newly-entered. Returns true if the specified validity tests are passed:
Generic logging function
return an html representation of the widget
return the current value as text and the widget as a hidden form element
set the value of this field
without validation or checking to see whether the field has changed.
Set display attributes for the field.
the attribute fielde are parsed differently for each different field subclass
set whether this field is editable or not
set the namebase for the data storage in the html form
create an SQL-injection-cleansed string for db statements
Generates a string that represents this field that can be used in an SQL UPDATE or INSERT statement. i.e. "name='Stuart'".
Quick and dirty display of the field status
update the value of the object with the user-supplied data in $data
$data is most probably from POST data etc.
The validity of the data is *not* checked at this stage, the object only takes the user-supplied value.
$data is an array with the data relevant to this field being in the key $this->namebase.$this->name.
For example:
PHP5 clone method
PHP5 clone statement will perform only a shallow copy of the object. Any subobjects must also be cloned
Documentation generated on Tue, 06 Mar 2007 10:01:32 +0000 by phpDocumentor 1.3.0