Inheritance diagram for AbstractField:
Most (read: all) fields inherit from this.
Definition at line 9 of file abstract-field.inc.php.
Public Member Functions | |
__construct ($name, Form &$parentForm, array $attribs=array()) | |
Constructor. | |
__get ($name) | |
Magic getter. | |
__set ($name, $value) | |
Magic setter. | |
validate () | |
Validate the feild's contents. | |
getTitle () | |
hasError () | |
Return the status of the field after running validate. | |
forceError () | |
Force the field to have an error. | |
getSqlImpl () | |
Get the SQL for this field. | |
setData ($value) | |
Set data. | |
getData () | |
Get the data value. | |
getJs () | |
Get any JavaScript needed for the field This is for JavaScript that will be common for all instances of this field type. | |
getCss () | |
Get any CSS needed for the field. | |
addAttributes (array $attr) | |
Add more attributes. | |
Public Attributes | |
$name = '' | |
Name of the Field, must correspond with a database column name if sync is used. | |
$definition = '' | |
Protected Member Functions | |
parseExtras (array $data) | |
Parse the extra values. | |
extrasAsAttributes () | |
Convert the extra attributes array as an HTML attribute string. | |
setDataFromRequest () | |
Set the form's data from the $_POST array. | |
convertSpecialRegex ($regExp, $defaultError) | |
Convert a special regex identifier (eg: 'number', 'float') into a real regex. | |
Static Protected Member Functions | |
assertAttributeIsArray (&$value) | |
Assert that an attribute value is an array. | |
assertAttributeIsObject ($type, &$value) | |
Assert that an attribute value is an instance of an object type. | |
Protected Attributes | |
$title = '' | |
Display title for the form. | |
$value = '' | |
Data value. | |
$attribs = array() | |
Array of extra attributes. | |
$required = false | |
Boolean flag, if true then the field will not validate until a vaild value is input. | |
$regExp = '' | |
Optional regular expression that is use to validate the input. | |
$errorMessage = '' | |
Error message to display if an error is encountered. | |
$hasError = false | |
Boolean flag set after validation. | |
$parentForm = '' | |
Reference to the parent Form object. |
|
Constructor.
Implements Field. Reimplemented in AbstractListField, AutoCompleteField, CheckboxField, CityStateZipField, CollectionField, ConditionalField, DateField, DateTimeField, EditorField, EmailField, GenderField, IpAddressField, NameField, PasswordChangeField, PhoneNumberField, SSNField, TimeField, and UsStateField. Definition at line 35 of file abstract-field.inc.php. References $attribs, hasError(), and parseExtras(). |
|
Magic getter.
Definition at line 55 of file abstract-field.inc.php. |
|
Magic setter.
Reimplemented in AbstractListField, ButtonField, CollectionField, ConditionalField, EditorField, PasswordChangeField, and UploadField. Definition at line 70 of file abstract-field.inc.php. References $name, and setData(). Referenced by parseExtras(). |
|
Add more attributes.
Definition at line 183 of file abstract-field.inc.php. |
|
Assert that an attribute value is an array.
Definition at line 270 of file abstract-field.inc.php. |
|
Assert that an attribute value is an instance of an object type.
Definition at line 281 of file abstract-field.inc.php. References $value. |
|
Convert a special regex identifier (eg: 'number', 'float') into a real regex. Also generates an error message appropirate for the resulting regex.
Definition at line 232 of file abstract-field.inc.php. References $regExp. |
|
Convert the extra attributes array as an HTML attribute string.
Definition at line 206 of file abstract-field.inc.php. Referenced by TextareaField::drawInput(), TextField::drawInput(), SelectField::drawInput(), RadioField::drawInput(), PasswordField::drawInput(), MultiSelectField::drawInput(), CheckboxField::drawInput(), and ButtonField::drawInput(). |
|
Force the field to have an error. This is most useful for forcing all fields in a collection to display as an error. Implements Field. Definition at line 131 of file abstract-field.inc.php. References hasError(). |
|
Get any CSS needed for the field.
Implements Field. Reimplemented in CollectionField, and PasswordChangeField. Definition at line 174 of file abstract-field.inc.php. |
|
Get the data value.
Implements Field. Reimplemented in ButtonField, CollectionField, DateTimeField, IpAddressField, MultiSelectField, PasswordField, PasswordChangeField, PhoneNumberField, and SSNField. Definition at line 157 of file abstract-field.inc.php. |
|
Get any JavaScript needed for the field This is for JavaScript that will be common for all instances of this field type.
Implements Field. Reimplemented in CollectionField, ConditionalField, and PasswordChangeField. Definition at line 166 of file abstract-field.inc.php. |
|
Get the SQL for this field.
Implements Field. Reimplemented in ButtonField, CheckboxListField, CityStateZipField, CollectionField, DateTimeField, IpAddressField, LabelField, NameField, PasswordField, PasswordChangeField, PhoneNumberField, and SSNField. Definition at line 140 of file abstract-field.inc.php. |
|
Definition at line 107 of file abstract-field.inc.php. |
|
Return the status of the field after running validate.
Implements Field. Reimplemented in ButtonField, and CollectionField. Definition at line 119 of file abstract-field.inc.php. References hasError(). Referenced by __construct(), forceError(), hasError(), and validate(). |
|
Parse the extra values.
Definition at line 193 of file abstract-field.inc.php. References __set(). Referenced by __construct(). |
|
Set data.
Implements Field. Reimplemented in CheckboxListField, DateTimeField, IpAddressField, MultiSelectField, PhoneNumberField, and SSNField. Definition at line 149 of file abstract-field.inc.php. Referenced by __set(). |
|
Set the form's data from the $_POST array.
Reimplemented in CollectionField, DateField, LabelField, and TimeField. Definition at line 218 of file abstract-field.inc.php. Referenced by validate(). |
|
Validate the feild's contents.
Implements Field. Reimplemented in ButtonField, CheckboxField, CollectionField, IpAddressField, PasswordChangeField, SSNField, and UploadField. Definition at line 85 of file abstract-field.inc.php. References hasError(), and setDataFromRequest(). |
|
Array of extra attributes.
Definition at line 14 of file abstract-field.inc.php. Referenced by __construct(). |
|
Definition at line 20 of file abstract-field.inc.php. |
|
Error message to display if an error is encountered.
Definition at line 17 of file abstract-field.inc.php. |
|
Boolean flag set after validation.
Definition at line 18 of file abstract-field.inc.php. |
|
Name of the Field, must correspond with a database column name if
Definition at line 11 of file abstract-field.inc.php. Referenced by __set(). |
|
Reference to the parent Form object.
Definition at line 19 of file abstract-field.inc.php. |
|
Optional regular expression that is use to validate the input.
Definition at line 16 of file abstract-field.inc.php. Referenced by convertSpecialRegex(). |
|
Boolean flag, if
Definition at line 15 of file abstract-field.inc.php. |
|
Display title for the form.
Definition at line 12 of file abstract-field.inc.php. |
|
Data value.
Definition at line 13 of file abstract-field.inc.php. Referenced by assertAttributeIsObject(). |