DB_Table
[ class tree: DB_Table ] [ index: DB_Table ] [ all elements ]

Class: example

Source Location: /DB_Table-1.3.0/tests/bogotest.php

Class Overview

DB_Table
   |
   --example

DB_Table is a database API and data type SQL abstraction class.


Author(s):

Version:

  • 1.3.0

Variables


Inherited Variables

Inherited Methods

Class: DB_Table

DB_Table::DB_Table()
Constructor.
DB_Table::addFormElements()
Adds elements and rules to a pre-existing HTML_QuickForm object.
DB_Table::alter()
Alters the table based on $this->col and $this->idx.
DB_Table::autoRecast()
Turns on (or off) automatic recasting of insert and update data.
DB_Table::autoValidInsert()
Turns on (or off) automatic validation of inserted data.
DB_Table::autoValidUpdate()
Turns on (or off) automatic validation of updated data.
DB_Table::buildSQL()
Builds the SQL command from a specified $this->sql element.
DB_Table::create()
Creates the table based on $this->col and $this->idx.
DB_Table::delete()
Deletes table rows matching a custom WHERE clause.
DB_Table::getBlankRow()
Returns a blank row array based on the column map.
DB_Table::getColumns()
Returns all or part of the $this->col property array.
DB_Table::getForm()
Creates and returns a QuickForm object based on table columns.
DB_Table::getFormElement()
Creates and returns a single QuickForm element based on a DB_Table column name.
DB_Table::getFormElements()
Creates and returns an array of QuickForm elements based on a DB_Table column name.
DB_Table::getFormGroup()
Creates and returns an array of QuickForm elements based on an array of DB_Table column names.
DB_Table::getIndexes()
Returns all or part of the $this->idx property array.
DB_Table::getPHPTypeAndDBSyntax()
Detect values of 'phptype' and 'dbsyntax' keys of DSN.
DB_Table::insert()
Inserts a single table row after validating through validInsert().
DB_Table::isRequired()
Is a specific column required to be set and non-null?
DB_Table::isValid()
Checks if a value validates against the DB_Table data type for a given column. This only checks that it matches the data type; it does not do extended validation.
DB_Table::modeSupported()
Is a creation mode supported for a RDBMS by DB_Table?
DB_Table::nextID()
Generates a sequence value; sequence name defaults to the table name.
DB_Table::quote()
Escapes and enquotes a value for use in an SQL query.
DB_Table::recast()
Forces array elements to the proper types for their columns.
DB_Table::select()
Selects rows from the table using one of the DB/MDB2 get*() methods.
DB_Table::selectCount()
Counts the number of rows which will be returned by a query.
DB_Table::selectResult()
Selects rows from the table as a DB_Result/MDB2_Result_* object.
DB_Table::setErrorMessage()
Overwrite one or more error messages, e.g. to internationalize them.
DB_Table::supported()
Is a particular RDBMS supported by DB_Table?
DB_Table::throwError()
Specialized version of throwError() modeled on PEAR_Error.
DB_Table::update()
Updates table row(s) matching a custom WHERE clause, after checking against validUpdate().
DB_Table::validInsert()
Validates an array for insertion into the table.
DB_Table::validUpdate()
Validates an array for updating the table.
DB_Table::verify()
Verifies the table based on $this->col and $this->idx.
DB_Table::_getFormColDefs()
Creates a column definition array suitable for DB_Table_QuickForm.

Class Details

[line 10]
DB_Table is a database API and data type SQL abstraction class.

DB_Table provides database API abstraction, data type abstraction, automated SELECT, INSERT, and UPDATE queries, automated table creation, automated validation of inserted/updated column values, and automated creation of QuickForm elemnts based on the column definitions.



[ Top ]


Class Variables

$col = array(
   
   
      'xvarchar' => array(
         'type'    => 'varchar',
         'size'    => 128,
         'require' => false,
         'qf_type' => 'radio',
         'qf_radiosep' => '<br />',
         'qf_vals' => array(
            'another',
            'other',
            'that',
            'this'
         )),'xbool'=>array('type'=>'boolean'),'xchar'=>array('type'=>'char','size'=>10,'require'=>true),'xclob'=>array('type'=>'clob','require'=>false),'xsmint'=>array('type'=>'smallint','require'=>false,'qf_client'=>true),'xint'=>array('type'=>'integer','require'=>true),'xbigint'=>array('type'=>'bigint','require'=>false),'xdecimal'=>array('type'=>'decimal','size'=>5,'scope'=>2,'require'=>false),'xsingle'=>array('type'=>'single','require'=>false),'xdouble'=>array('type'=>'double','require'=>false),'xdate'=>array('type'=>'date','default'=>"'0001-01-01'",'require'=>false),'xtime'=>array('type'=>'time','default'=>"'00:00:00'",'require'=>false),'xtimestamp'=>array('type'=>'timestamp'),)

[line 12]


Type:   mixed
Overrides:   Array


[ Top ]

$idx = array(
      'id' => array(
         'type' => 'unique',
         'cols' => array('xint')),'multi'=>array('type'=>'normal','cols'=>array('xdate','xtime','xchar')))

[line 88]


Type:   mixed
Overrides:   Array


[ Top ]

$sql = array(
      'list' => array(
         'select' => '*',
         'get'    => 'row'
      ))

[line 99]


Type:   mixed
Overrides:   Array


[ Top ]



Documentation generated on Wed, 26 Apr 2006 12:03:18 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.