Comments: on this page. Click to read or post your own.
Abstract database connectivity class.
Sub-classes of this implement the actual database connection libraries
Located in /sapphire/core/model/Database.php (line 8)
Object | --Database
| Class | Description |
|---|---|
| PDODatabase | PDO (general database) connector class. |
| MySQLDatabase | MySQL connector class. |
Connection object to the database.
If this is false, then information about database operations will be displayed, eg creation of tables.
The field list, generated by the fieldList() function.
An array of maps of field name => field spec, indexed by table name.
The index list for each table, generated by the indexList() function.
An map from table name to an array of index names.
Large array structure that represents a schema update transaction
The table list, generated by the tableList() function.
Used by the requireTable() function.
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Replaces "\'\'" with "null", recursively walks through the given array.
Alter a table's schema.
Start a schema-updating transaction.
All calls to requireTable/Field/Index will keep track of the changes requested, but not actually do anything. Once
Create the database and connect to it. This can be called if the initial database connection is not successful because the database does not exist.
It takes no parameters, and should create the database from the information specified in the constructor.
Create a new field on a table.
Create a new table.
The table will have a single field - the integer key ID.
Error handler for database errors.
All database errors will call this function to report the error. It isn't a static function; it will be called on the object itself and as such can be overridden in a subclass.
If the given table exists, move it out of the way by renaming it to _obsolete_(tablename).
Get a list of all the fields for the given table.
Returns a map of field name => field spec.
Build the connection string from input
Get the autogenerated ID from the previous INSERT query.
Check if the connection to the database is active.
Execute a complex manipulation on the database.
A manipulation is an array of insert / or update sequences. The keys of the array are table names, and the values are map containing 'command' and 'fields'. Command should be 'insert' or 'update', and fields should be a map of field names to field values, including quotes. The field value can also be a SQL function or similar.
Execute the given SQL query.
This abstract function must be defined by subclasses as part of the actual implementation. It should return a subclass of Query as the result.
Enable supression of database messages.
Rename a table.
Generate the given field on the table, modifying whatever already exists as necessary.
Generate the given index in the database, modifying whatever already exists as necessary.
Generate the following table in the database, modifying whatever already exists as necessary.
Returns a list of all tables in the database.
The table names will be in lower case.
Handler for the other transXXX methods - mark the given table as being altered
if it doesn't already exist
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Sun, 19 Oct 2008 06:39:44 +1300 by phpDocumentor 1.3.2