Auto Form Utilities, Validation, Autoloading

Auto Form Utilities, Validation, Autoloading  --  ::setFrom(), ::validate(), and DB_DataObject::staticAutoLoad()

::setFrom()

Copies data from an Array or object into the current object

::setFrom ((Array or Object) from)

copies all the data that relates to this table (Except keys) into the current object

Copies all the data (with names the of this objects columns) from another object or array into this one.

::validate()

Either validates data as Integers or strings, otherwise calls user defined validation methods

(mixed boolean or array)::validate ()

check all the objects variables to see if they are valid, by default this means is a column an integer or string, if you define methods like validateEmail(), in your extended class then it will be called to validate that rows data.

Note: that this validation depends on the PEAR validation package

To add a validation routine to your extended class you should create a method with the name, ValidateXXXXXXX where XXXXX is the name of the row to validate.
Refer to the Validation package for more details on Validation methods.

::staticAutoloadTable()

automatically load (include a DataObject class)

string classname::staticAutoLoadTable (string tablename)

based on the config file, automatically includes the class definition for a table and returns the class name