Andrew's Web Libraries (AWL)
Loading...
Searching...
No Matches
DBRecord Class Reference
Inheritance diagram for DBRecord:

Public Member Functions

 __construct ()
 
 Initialise ( $table, $keys=array())
 
 AddTable ( $table, $target_list, $join_clause, $and_where)
 
 PostToValues ( $prefix="")
 
 _BuildJoinClause ()
 
 _BuildFieldList ()
 
 _BuildWhereClause ($overwrite_values=false)
 
 Set ($fname, $fval)
 
 Get ($fname)
 
 Undefine ($fname)
 
 Write ()
 
 Read ()
 

Public Attributes

 $Table
 
 $Fields
 
 $Keys
 
 $Values
 
 $WriteType
 
 $OtherTable
 
 $OtherTargets
 
 $OtherJoin
 
 $OtherWhere
 
 $EditMode
 

Detailed Description

Definition at line 122 of file DataUpdate.php.

Constructor & Destructor Documentation

◆ __construct()

DBRecord::__construct ( )

#- Really numbingly simple construction.

Definition at line 202 of file DataUpdate.php.

Member Function Documentation

◆ _BuildFieldList()

DBRecord::_BuildFieldList ( )

Builds a field target list

Returns
string A simple SQL target field list for each field, possibly including prefixes.

Definition at line 274 of file DataUpdate.php.

◆ _BuildJoinClause()

DBRecord::_BuildJoinClause ( )

Builds a table join clause

Returns
string A simple SQL target join clause excluding the primary table.

Definition at line 259 of file DataUpdate.php.

◆ _BuildWhereClause()

DBRecord::_BuildWhereClause ( $overwrite_values = false)

Builds a where clause to match the supplied keys

Parameters
boolean$overwrite_valuesControls whether the data values for the key fields will be forced to match the key values
Returns
string A simple SQL where clause, including the initial "WHERE", for each key / value.

Definition at line 295 of file DataUpdate.php.

◆ AddTable()

DBRecord::AddTable ( $table,
$target_list,
$join_clause,
$and_where )

This will join an additional table to the maintained set

Parameters
string$tableThe name of the database table
array$keysAn associative array containing fieldname => value pairs for the record key.
string$joinA PostgreSQL join clause.
string$prefixA field prefix to use for these fields to distinguish them from fields in other joined tables with the same name.

Definition at line 233 of file DataUpdate.php.

◆ Get()

DBRecord::Get ( $fname)

Returns a single field from the record

Parameters
string$fnameThe name of the field to set the value for
Returns
mixed The current value of the field.

Definition at line 333 of file DataUpdate.php.

◆ Initialise()

DBRecord::Initialise ( $table,
$keys = array() )

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

Parameters
string$tableThe name of the database table
array$keysAn associative array containing fieldname => value pairs for the record key.

Definition at line 217 of file DataUpdate.php.

◆ PostToValues()

DBRecord::PostToValues ( $prefix = "")

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

Definition at line 245 of file DataUpdate.php.

◆ Read()

DBRecord::Read ( )

To read the record from the database. If we don't have any keys then the record will be blank.

Returns
boolean Whether we actually read a record.

Definition at line 367 of file DataUpdate.php.

◆ Set()

DBRecord::Set ( $fname,
$fval )

Sets a single field in the record

Parameters
string$fnameThe name of the field to set the value for
string$fvalThe value to set the field to
Returns
mixed The new value of the field (i.e. $fval).

Definition at line 322 of file DataUpdate.php.

◆ Undefine()

DBRecord::Undefine ( $fname)

Unsets a single field from the record

Parameters
string$fnameThe name of the field to unset the value for
Returns
mixed The current value of the field.

Definition at line 343 of file DataUpdate.php.

◆ Write()

DBRecord::Write ( )

To write the record to the database

Returns
boolean Success.

Reimplemented in User.

Definition at line 355 of file DataUpdate.php.

Member Data Documentation

◆ $EditMode

DBRecord::$EditMode

Definition at line 195 of file DataUpdate.php.

◆ $Fields

DBRecord::$Fields

Definition at line 138 of file DataUpdate.php.

◆ $Keys

DBRecord::$Keys

Definition at line 144 of file DataUpdate.php.

◆ $OtherJoin

DBRecord::$OtherJoin

Definition at line 177 of file DataUpdate.php.

◆ $OtherTable

DBRecord::$OtherTable

Definition at line 162 of file DataUpdate.php.

◆ $OtherTargets

DBRecord::$OtherTargets

Definition at line 170 of file DataUpdate.php.

◆ $OtherWhere

DBRecord::$OtherWhere

Definition at line 184 of file DataUpdate.php.

◆ $Table

DBRecord::$Table

Definition at line 131 of file DataUpdate.php.

◆ $Values

DBRecord::$Values

Definition at line 150 of file DataUpdate.php.

◆ $WriteType

DBRecord::$WriteType

Definition at line 156 of file DataUpdate.php.


The documentation for this class was generated from the following file: