Class DB_dbtable

Description

Class describing a Postgres database table. Inherits the standard dbtable class properties and methods, but adds in the getschema specifics for acquiring Postgres table info from the metadata, and provides a specific create() method.

Located in /pg-schema-defs.php (line 509)

SchemaObject
   |
   --dbtable
      |
      --DB_dbtable
Method Summary
 DB_dbtable DB_dbtable (mixed &$schema, string $name, integer $dbversion)
 void addcolumn (mixed $column)
 void create ()
 void create_indexes ()
 void getschema ([mixed $mode = ALL], mixed $schema)
 void newfield (mixed $name, mixed $num, mixed $type, [mixed $defaultval = ""], [mixed $notnull = false], [mixed $isarray = false])
 void setnullconstraint (mixed $column)
Variables
Methods
Constructor DB_dbtable (line 515)

Construct a table of given name and array of primary key fields.

DB_dbtable DB_dbtable (mixed &$schema, string $name, integer $dbversion)
  • string $name: The name of the table
  • integer $dbversion: Optional database version information
addcolumn (line 895)

Return SQL which will create a column in this table. The $column passed in is actually a field object.

void addcolumn (mixed $column)

Redefinition of:
dbtable::addcolumn()
Return SQL which will create a column in this table. The $column passed in is actually a field object.
create (line 865)

Return the SQL which will create this Postgres table.

NB: We also create the indexes and constraints which pertain to this table at the same time.

void create ()

Redefinition of:
dbtable::create()
Return the SQL which will create this table.
create_constraints (line 947)

Return the SQL which will create the constraints on this table.

Usually this SQL has to come after all table creates have been done, so that references to tables are all honoured, hence a separate method here.

void create_constraints ()
create_indexes (line 958)

Return the SQL which will create the indexes on this table.

void create_indexes ()
getschema (line 524)

Acquires the table fields and constraints which apply to it.

NB: This function is apt for Postgres. Over-ride for other db types

void getschema ([mixed $mode = ALL], mixed $schema)
  • mixed $schema: Schema this table is in, or false if n/a

Redefinition of:
dbtable::getschema()
Acquires the schema from database metadata.
newfield (line 846)

Create a new field in the table with given parameters.

void newfield (mixed $name, mixed $num, mixed $type, [mixed $defaultval = ""], [mixed $notnull = false], [mixed $isarray = false])

Redefinition of:
dbtable::newfield()
Create a new field in the table with given parameters.
setnullconstraint (line 921)

Return SQL to set the NULL/NOT NULL constraint..

void setnullconstraint (mixed $column)

Redefinition of:
dbtable::setnullconstraint()
Return SQL to set the NULL/NOT NULL constraint..

Inherited Methods

Inherited From dbtable

 dbtable::dbtable()
 dbtable::addcolumn()
 dbtable::addfield()
 dbtable::create()
 dbtable::drop()
 dbtable::dropcolumn()
 dbtable::dump()
 dbtable::getfield()
 dbtable::getfieldbynum()
 dbtable::getfieldnum()
 dbtable::getkeyfieldnames()
 dbtable::getlabelfield()
 dbtable::getnonkeyfieldnames()
 dbtable::getorderfield()
 dbtable::getschema()
 dbtable::newfield()
 dbtable::setdefault()
 dbtable::setnullconstraint()

Inherited From SchemaObject

 SchemaObject::SchemaObject()

Documentation generated by phpDocumentor 1.3.0RC3