Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CollectionField Class Reference
[Collection Fields]

Inheritance diagram for CollectionField:

AbstractField Field CityStateZipField ConditionalField DateTimeField IpAddressField NameField PasswordChangeField PhoneNumberField SSNField List of all members.

Detailed Description

A field that is a set of multiple fields.

Author:
Scott Peshak
Date:
Date
2006-04-27 12:25:42 -0500 (Thu, 27 Apr 2006)

Definition at line 8 of file collection-field.inc.php.

Public Member Functions

 __construct ($name, Form &$parentForm, array $attribs=array())
 Constructor.
 __set ($name, $value)
 Magic setter.
add ($type, $name, array $options=array())
 Add field to collection.
 hasField ($name)
 Tells us if we have a field or not.
 setFieldsData ($data)
 Sets the data on our fields in our collection.
 drawInput ()
 Draw the fields.
 setDataFromRequest ()
 Set the field data from the $_REQUEST array.
 validate ()
 Validate all fields in the collection.
 hasError ()
 Check to see if any fields in the collection have an error.
 getSqlImpl ()
 Get SQL for all fields in the collection.
 getJs ()
 Get a string of JavaScript needed for this field.
 getCss ()
 Get the CSS for all subfields.
 allFieldsHaveData ()
 Check to see if all fields in the collection have a data value.
 noFieldsHaveData ()
 Check to see if none of the fields in the collection have a non-null value.
 getData ()
 Get the data value.

Protected Attributes

 $fields
 Array of Field objects that make up the collection.
 $autoAdvance
 Boolean flag, if true then the user will be automatically advanced through the fields.
 $arrangement
 Mode to use for arranging the sub fields, either horizontal (default) or vertical.

Static Protected Attributes

 $jsDrawn
 Boolean flag if the drawJs method had been called yet.

Private Member Functions

 getNextFieldId ($num)
 Get the ID of the next field.
 getPrevFieldId ($num)
 Get the ID of the previous field for auto advance purposes.

Static Private Attributes

 $skipFieldTypes = array('HiddenField', 'LabelField')
 Array of field types to skip over when auto advancing.


Member Function Documentation

CollectionField::__construct name,
Form &$  parentForm,
array $  attribs = array()
 

Constructor.

Parameters:
$name Name of collection
$parentForm Form object that the field belongs to.
$attribs Extra attributes

Reimplemented from AbstractField.

Reimplemented in CityStateZipField, ConditionalField, DateTimeField, IpAddressField, NameField, PasswordChangeField, PhoneNumberField, and SSNField.

Definition at line 22 of file collection-field.inc.php.

CollectionField::__set name,
value
 

Magic setter.

Parameters:
$name Name of member to set
$value Value to set

Reimplemented from AbstractField.

Reimplemented in ConditionalField, and PasswordChangeField.

Definition at line 36 of file collection-field.inc.php.

References add().

& CollectionField::add type,
name,
array $  options = array()
 

Add field to collection.

Parameters:
$type Field type.
$name Name of field.
$options Array of extra options.
Returns:
Reference to the added Field.

Definition at line 71 of file collection-field.inc.php.

References Form::hasField().

Referenced by PhoneNumberField::__construct(), and __set().

CollectionField::allFieldsHaveData  ) 
 

Check to see if all fields in the collection have a data value.

Returns:
Boolean true if all fields have some value

Definition at line 290 of file collection-field.inc.php.

Referenced by SSNField::validate(), and IpAddressField::validate().

CollectionField::drawInput  ) 
 

Draw the fields.

Implements Field.

Reimplemented in ConditionalField, and PasswordChangeField.

Definition at line 114 of file collection-field.inc.php.

References getNextFieldId().

CollectionField::getCss  ) 
 

Get the CSS for all subfields.

Returns:
string of CSS

Reimplemented from AbstractField.

Reimplemented in PasswordChangeField.

Definition at line 275 of file collection-field.inc.php.

References Form::getCss().

CollectionField::getData  ) 
 

Get the data value.

Reimplemented from AbstractField.

Reimplemented in DateTimeField, IpAddressField, PasswordChangeField, PhoneNumberField, and SSNField.

Definition at line 319 of file collection-field.inc.php.

References Form::getData().

CollectionField::getJs  ) 
 

Get a string of JavaScript needed for this field.

Returns:
string of JavaScript

Reimplemented from AbstractField.

Reimplemented in ConditionalField, and PasswordChangeField.

Definition at line 217 of file collection-field.inc.php.

CollectionField::getNextFieldId num  )  [private]
 

Get the ID of the next field.

Parameters:
$num The number of the field to check for.
Returns:
ID of next field, or the string 'null' if there is no next.

Definition at line 186 of file collection-field.inc.php.

Referenced by drawInput().

CollectionField::getPrevFieldId num  )  [private]
 

Get the ID of the previous field for auto advance purposes.

Parameters:
$num The number of the field to check for.
Returns:
ID of previous field, or the string 'null' if there is no previous.

Definition at line 202 of file collection-field.inc.php.

CollectionField::getSqlImpl  ) 
 

Get SQL for all fields in the collection.

Returns:
SQL string

Reimplemented from AbstractField.

Reimplemented in CityStateZipField, DateTimeField, IpAddressField, NameField, PasswordChangeField, PhoneNumberField, and SSNField.

Definition at line 171 of file collection-field.inc.php.

CollectionField::hasError  ) 
 

Check to see if any fields in the collection have an error.

Returns:
Boolean true if any fields have an error, false otherwise.

Reimplemented from AbstractField.

Definition at line 158 of file collection-field.inc.php.

CollectionField::hasField name  ) 
 

Tells us if we have a field or not.

Parameters:
$name the field name to check for.
Returns:
boolean if it has it or not.

Definition at line 88 of file collection-field.inc.php.

CollectionField::noFieldsHaveData  ) 
 

Check to see if none of the fields in the collection have a non-null value.

Returns:
Boolean true if none of the fields have a value

Definition at line 307 of file collection-field.inc.php.

Referenced by SSNField::validate(), and IpAddressField::validate().

CollectionField::setDataFromRequest  ) 
 

Set the field data from the $_REQUEST array.

Reimplemented from AbstractField.

Definition at line 139 of file collection-field.inc.php.

CollectionField::setFieldsData data  ) 
 

Sets the data on our fields in our collection.

Parameters:
$data the data to set to the fields.

Definition at line 102 of file collection-field.inc.php.

References Form::setData().

CollectionField::validate  ) 
 

Validate all fields in the collection.

Reimplemented from AbstractField.

Reimplemented in IpAddressField, PasswordChangeField, and SSNField.

Definition at line 148 of file collection-field.inc.php.

References Form::validate().


Member Data Documentation

CollectionField::$arrangement [protected]
 

Mode to use for arranging the sub fields, either horizontal (default) or vertical.

Definition at line 14 of file collection-field.inc.php.

CollectionField::$autoAdvance [protected]
 

Boolean flag, if true then the user will be automatically advanced through the fields.

Definition at line 11 of file collection-field.inc.php.

CollectionField::$fields [protected]
 

Array of Field objects that make up the collection.

Definition at line 10 of file collection-field.inc.php.

CollectionField::$jsDrawn [static, protected]
 

Boolean flag if the drawJs method had been called yet.

Reimplemented in ConditionalField.

Definition at line 13 of file collection-field.inc.php.

CollectionField::$skipFieldTypes = array('HiddenField', 'LabelField') [static, private]
 

Array of field types to skip over when auto advancing.

Definition at line 12 of file collection-field.inc.php.


The documentation for this class was generated from the following file:
Generated on Fri Oct 27 12:26:41 2006 for BaseJumper by doxygen 1.3.9.1