Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/mitarbeiter/sven/public_html/tmp/devcon_php_base/dbi/dbdepend.class
dev/con php base - Database interfaces

DBDEPEND

DBDEPEND

SQL database description.

 

public class DBDEPEND

SQL database description.

AuthorsSven Klose <sven@devcon.net>

 

Public Method Summary

void

define_table(string $table, array $fields)

Define columns of a table.
array

types([ string $table ])

Return array of extended field description of a $table.
void

set_ref(string $table, string $ref_table, string $ref_id)

Define a cross-table reference.
string

ref_table(string $table)

Get name of a parent table.
string

ref_id(string $table)

Get name of field with reference to a parent record.
void

set_listref(string $table, string $id_last, string $id_next)

Define the reference fields to siblings of rows in a table.
void

is_list(string $table)

Determine if a table holds lists (defined using set_listref ())
void

set_xref(string $table, string $xref_table)

Define n:n reference table.
string

xref_table(string $table)

Get name of n:n reference table.
string

prev_of(string $table)

Get name of field that points to the previous row in a list.
string

next_of(string $table)

Get name of field that points to the next row in a list.
void

set_primary(string $table, string $primary)

Define field name for a table's primary key.
string

primary(string $table)

Get field name of primary key.

Private Method Summary

void

_chktbl(string $table, string $func)

Check if a table is defined.

Private Field Summary

unknown

$_ref_table

unknown

$_ref_id

unknown

$_obj_id

unknown

$_xref_tables

unknown

$table

unknown

$_types

unknown

$_exttypes

unknown

$_desc

unknown

$_refs

unknown

$_listrefs

unknown

$_primaries

Public Method Details

define_table

public void define_table( string $table, array $fields )

  Define columns of a table.
The field types are described by array over array that hold variousinformation about each column:array (array ('field_info' => 'data', # Field A'field_info' => 'data'),array ('field_info' => 'data', # Field B'field_info' => 'data'),#...);Each column description must contain the following field infos:'n' - Name't' - SQL typeOptional:'i' - Index is created for faster lookups if true.'e' - Extended type from dbi/types.phpTODO: Generic primary key handling.

Parameter
string $table
Table name.
array $fields
Array of field descriptions.
Returns void


types

public array types( [ string $table ] )

  Return array of extended field description of a $table.

Parameter
string $table = >>''<<
Table name.
Returns array

Array of types for each field keyed by name. If the
table name is empty, an array of all type arrays is
returned which is keyed by table names.


set_ref

public void set_ref( string $table, string $ref_table, string $ref_id )

  Define a cross-table reference.
When using multi-delete, all records that point to a record which isdeleted, they are also removed.This way you can create a tree structure by letting a table point toitself.

Parameter
string $table
Name of table that holds the reference.
string $ref_table
Name of the column that holds the primary key's value of the
referenced row.
string $ref_id
Name of the table that is referenced. The table's primary key
must be defined using set_primary().
Returns void


ref_table

public string ref_table( string $table )

  Get name of a parent table.

Parameter
string $table
Table name.
Returns string

Name of the parent table.


ref_id

public string ref_id( string $table )

  Get name of field with reference to a parent record.

Parameter
string $table
Table name.
Returns string

Name of the field in $table.


set_listref

public void set_listref( string $table, string $id_last, string $id_next )

  Define the reference fields to siblings of rows in a table.

Parameter
string $table
The table name.
string $id_last
Column name that holds the primary key of the
previous row.
string $id_next
Column name that holds the primary key of the
next row.
Returns void


is_list

public void is_list( string $table )

  Determine if a table holds lists (defined using set_listref ())

Parameter
string $table
The table name.
Returns void


set_xref

public void set_xref( string $table, string $xref_table )

  Define n:n reference table.

Parameter
string $table
The table name.
string $xref_table
The reference table name.
Returns void


xref_table

public string xref_table( string $table )

  Get name of n:n reference table.

Parameter
string $table
The table name.
Returns string

Reference Table name.


prev_of

public string prev_of( string $table )

  Get name of field that points to the previous row in a list.

Parameter
string $table
The table name.
Returns string

Field name.


next_of

public string next_of( string $table )

  Get name of field that points to the next row in a list.

Parameter
string $table
The table name.
Returns string

Field name.


set_primary

public void set_primary( string $table, string $primary )

  Define field name for a table's primary key.

Parameter
string $table
The table name.
string $primary
Primary field name.
Returns void


primary

public string primary( string $table )

  Get field name of primary key.

Parameter
string $table
The table name.
Returns string

Primary field name.


Private Method Details

_chktbl

private void _chktbl( string $table, string $func )

  Check if a table is defined.

Parameter
string $table
The table name.
string $func
Function name to show if function dies.
Returns void


Private Field Details

$_ref_table

private unknown $_ref_table

>><<



$_ref_id

private unknown $_ref_id

>><<



$_obj_id

private unknown $_obj_id

>><<



$_xref_tables

private unknown $_xref_tables

>><<



$table

private unknown $table

>><<



$_types

private unknown $_types

>><<



$_exttypes

private unknown $_exttypes

>><<



$_desc

private unknown $_desc

>><<



$_refs

private unknown $_refs

>><<



$_listrefs

private unknown $_listrefs

>><<



$_primaries

private unknown $_primaries

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta