Class MyDatabase

MyDatabase
Direct Known Subclasses:
Accounts, Actions, Activity, Configuration, Groups, Security, WriteLog

public class MyDatabase

A class that handles some common database functions


Constructor Summary
MyDatabase()
          Constructor of the class MyDatabase.
 
Method Summary
 unknown dbFailure()
          Method to send a message when a Database Failure occurs.
 string Field(var $FieldName, var $Value)
          Method to get/set the field value by a given field name.
 newid InsertNew(var $extra, var $haltOnError)
          Method to Insert data to a table by using the nextval for the key.
 bool Update(var $haltOnError)
          Method to Update data from a table.
 

Constructor Detail

MyDatabase

public MyDatabase()
Constructor of the class MyDatabase.
Method Detail

InsertNew

public newid InsertNew(var $extra,
                       var $haltOnError)
Method to Insert data to a table by using the nextval for the key. You have to supply table name, keyname, field names and values. It will return the key of the table on success. False on error.
Parameters:
$extra - Default Value: ""
$haltOnError - Default Value: 1

Update

public bool Update(var $haltOnError)
Method to Update data from a table.
Parameters:
$haltOnError - Default Value: 1

Field

public string Field(var $FieldName,
                    var $Value)
Method to get/set the field value by a given field name. If you want to set a value, the second parameter should be set to the new value you want. If you want to initialize a field, you MUST PASS String 'null'. This will force the method to set the value based on it's type definition in the class. I mean like : $this->mTableFields[$FieldName]['type']= integer will be initialized to zero, because it is an integer, null to a string.
Parameters:
$Value - Default Value: null

dbFailure

public unknown dbFailure()
Method to send a message when a Database Failure occurs.