Class DBRecord

Description

A Base class to use for records which will be read/written from the database.

Located in /DataUpdate.php (line 122)


	
			
Direct descendents
Class Description
 class User A class to handle reading, writing, viewing, editing and validating usr records.
Variable Summary
 object $EditMode
Method Summary
 DBRecord DBRecord ()
 void AddTable (string $table,  $target_list,  $join_clause,  $and_where, array $keys, string $join, string $prefix)
 mixed Get (string $fname)
 void Initialise (string $table, [array $keys = array()])
 void PostToValues ([ $prefix = ""])
 boolean Read ()
 mixed Set (string $fname, string $fval)
 mixed Undefine (string $fname)
 boolean Write ()
 string _BuildFieldList ()
 string _BuildJoinClause ()
 string _BuildWhereClause ([boolean $overwrite_values = false])
Variables
Strict Standards: Only variables should be passed by reference in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 712 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/share/php/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/Smarty_Compiler.class.php on line 370
object $EditMode (line 195)

The mode we are in for any form

  • access: public
Methods
Constructor DBRecord (line 202)

Really numbingly simple construction.

DBRecord DBRecord ()
AddTable (line 233)

This will join an additional table to the maintained set

void AddTable (string $table,  $target_list,  $join_clause,  $and_where, array $keys, string $join, string $prefix)
  • string $table: The name of the database table
  • array $keys: An associative array containing fieldname => value pairs for the record key.
  • string $join: A PostgreSQL join clause.
  • string $prefix: A field prefix to use for these fields to distinguish them from fields in other joined tables with the same name.
  • $target_list
  • $join_clause
  • $and_where
Get (line 333)

Returns a single field from the record

  • return: The current value of the field.
mixed Get (string $fname)
  • string $fname: The name of the field to set the value for
Initialise (line 217)

This will read the record from the database if it's available, and the $keys parameter is a non-empty array.

void Initialise (string $table, [array $keys = array()])
  • string $table: The name of the database table
  • array $keys: An associative array containing fieldname => value pairs for the record key.
PostToValues (line 245)

This will assign $_POST values to the internal Values object for each field that exists in the Fields array.

void PostToValues ([ $prefix = ""])
  • $prefix
Read (line 367)

To read the record from the database.

If we don't have any keys then the record will be blank.

  • return: Whether we actually read a record.
boolean Read ()
Set (line 322)

Sets a single field in the record

  • return: The new value of the field (i.e. $fval).
mixed Set (string $fname, string $fval)
  • string $fname: The name of the field to set the value for
  • string $fval: The value to set the field to
Undefine (line 343)

Unsets a single field from the record

  • return: The current value of the field.
mixed Undefine (string $fname)
  • string $fname: The name of the field to unset the value for
Write (line 355)

To write the record to the database

  • return: Success.
boolean Write ()

Redefined in descendants as:
_BuildFieldList (line 274)

Builds a field target list

  • return: A simple SQL target field list for each field, possibly including prefixes.
string _BuildFieldList ()
_BuildJoinClause (line 259)

Builds a table join clause

  • return: A simple SQL target join clause excluding the primary table.
string _BuildJoinClause ()
_BuildWhereClause (line 295)

Builds a where clause to match the supplied keys

  • return: A simple SQL where clause, including the initial "WHERE", for each key / value.
string _BuildWhereClause ([boolean $overwrite_values = false])
  • boolean $overwrite_values: Controls whether the data values for the key fields will be forced to match the key values

Documentation generated on Wed, 04 Jul 2012 07:06:13 +0000 by phpDocumentor 1.4.3