Class nonDBRow

Description

Equivalent to DBRow where the database is not involved

Object representing a NON-database row (and extensible to represent joined rows)

Usage:

  1.    #set database connection parameters
  2.       $obj new nonDBRow();
  3.    #set the fields required and their attributes
  4.       $obj->addElement(....);
  5.    #check to see if user data changes some values
  6.       $obj->update($POST);
  7.    $obj->checkValid();

Located in /inc/formslib/nondbrow.php (line 41)


	
			
Direct descendents
Class Description
DateRange DateRange display/data reflection class
Variable Summary
boolean $changed
integer $DEBUG
string $description
string $dumpheader
boolean $editable
string $errorMessage
array $extrarows
boolean $fatal_sql
array $fields
array $headings
boolean $isValid
string $longname
string $name
string $namebase
boolean $newObject
Method Summary
nonDBRow nonDBRow (string $name, string $longname, string $description)
void addElement (Field $el)
void addElements (array $els)
boolean checkValid ()
string display ([ $data = NULL])
string displayInTable ([ $numCols = 2], [ $extraClass = ''], integer $j)
void log (string $logstring, [integer $priority = 10])
string text_dump ()
boolean update (array $data)
Variables
boolean $changed = 0 (line 57)
  • var: the fields in this row have changed cf the database
integer $DEBUG = 0 (line 74)
  • var: debug level 0=off
string $description (line 47)
  • var: description for the field in the mouse-over
string $dumpheader = 'nonDBRow object' (line 63)
  • var: output when doing text dumps of the object
boolean $editable = 1 (line 51)
  • var: this row is editable
string $errorMessage = '' (line 55)
  • var: current error message
array $extrarows (line 67)
  • var: additional rows to be included at the end of the display table
boolean $fatal_sql = 1 (line 65)
  • var: sql errors should be considered fatal and the script will die()
array $fields (line 69)
  • var: list of Field objects in this row
array $headings (line 71)
  • var: list of column headings for tabular display
boolean $isValid = 0 (line 59)
  • var: the data in the fields are valid
string $longname (line 45)
  • var: label for the field in the display
string $name (line 43)
  • var: name of this field
string $namebase (line 53)
  • var: prefixed to all name="$field[name]" sections of the html code
boolean $newObject = 0 (line 49)
  • var: this is a new object the form for which has not yet been shown to the user
boolean $suppressValidation = 0 (line 61)
  • var: don't to validation on this row
Methods
Constructor nonDBRow (line 84)

Create a new generic field/row object not linked to the db

nonDBRow nonDBRow (string $name, string $longname, string $description)
  • string $name: the name of the field (db name, and html field name
  • string $longname: long name to be used in the label of the field in display
  • string $description: used in the html title or longdesc for the field
addElement (line 164)

Add a new field to the row

Add an element into the fields[] array. The element must conform to the Fields class (or at least its interface!) as that will be assumed elsewhere in this object. Inheritable attributes are also set here.

void addElement (Field $el)
  • Field $el: the field to add
addElements (line 188)

Add multiple new fields to the row

Adds multiple elements into the fields[] array.

void addElements (array $els)
  • array $els: array of Field objects
checkValid (line 130)

check the validity of the data

  • return: data is valid
boolean checkValid ()
display (line 214)

Display the object

  • return: object representation
string display ([ $data = NULL])
  • $data

Redefined in descendants as:
displayInTable (line 225)

Display the row as a form in a table

  • return: html table
string displayInTable ([ $numCols = 2], [ $extraClass = ''], integer $j)
  • integer $j: (optional) number of columns in the table (will pad as necessary)
  • $numCols
  • $extraClass
log (line 258)

Debug print function.

void log (string $logstring, [integer $priority = 10])
  • string $logstring: debug message to be output
  • integer $priority: priority of the message, will not be written unless $priority <= $this->DEBUG
text_dump (line 200)

Create a quick text representation of the object

  • return: text representation
string text_dump ()
update (line 98)

Update the object with the user-submitted data

update the value of each of the objects fields according to the user input data, and validate the data if appropriate

  • return: data is valid
boolean update (array $data)
  • array $data: user supplied data (field => $value)

Documentation generated on Tue, 06 Mar 2007 10:01:46 +0000 by phpDocumentor 1.3.0