Public Method Details |
table_relations |
public void table_relations( string &$table_relations_bu )
|
|
constructor function
references the global table relations array and produces atop down view in $this->tr_td
|
Parameter |
|
string |
&$table_relations_bu |
|
|
The name of the table relations array.
This is a reference, so that they can be changed, after first instantiating
the object |
|
Returns |
void |
|
process_table_rel |
public void process_table_rel( )
|
|
Process table relations
Build a top-down array from the table relations, which are in bottom up format.This has been separated from the constructor, so that it can be called from a function,if the table defintions have been changed.
|
Returns |
void |
|
get_f_table |
public string get_f_table( string $table, string $fieldname, array $row )
|
|
Returns the table a foreign key in a table points to
get_f_table uses the bottom-up relationship array to determine the targettable. If the foreign key points to multiple tables, it looks up, which tableis set in the row.
|
Parameter |
|
string |
$table |
|
|
the table where the foreign key is in |
|
|
string |
$fieldname |
|
|
the name of the foreign key |
|
|
array |
$row |
|
|
the complete row of the table where the foreign
key is in. |
|
Returns |
string The table where the fkex points to. |
|
get_first_f_table |
public array get_first_f_table( string $table, array $currrow )
|
|
returns the an assotiative array with the first table which is
referenced by a foreign key and the name of that key.get_first_f_table is used, when we want to traverse the table relationfrom bottom to top. If currrow is empty, always the first table is used.If there are multiple tables for a fkey, the first one is used.If currrow is set, then the table of multiple tables is determined fromthe content of currrow.
|
Parameter |
|
string |
$table |
|
|
the table we want to use the foreign key from |
|
|
array |
$currrow |
|
|
the current data row in that table |
|
Returns |
array : with the following entries
- tablename the first fkey points to
- the field name of the fkey |
|
get_fkey_by_subtable |
public string get_fkey_by_subtable( string $toptable, string $subtable )
|
|
returns the name of an fkey for a referenced table. This is used to look up
rows in a table which contains a foreign key
|
Parameter |
|
string |
$toptable |
|
|
the name of the table which contains the primary key |
|
|
string |
$subtable |
|
|
the name of the table which contains the foreign key |
|
Returns |
string : the fkey name |
|
get_sub_tables |
public array get_sub_tables( string $table )
|
|
returns a partition of the top down view: an array with all tables that
point a foreign key to this table (subtables).
|
Parameter |
|
string |
$table |
|
|
: the table the foreign keys point to |
|
Returns |
array : array with table names as key and the foreign key field name as value. |
|
get_src_complexity |
public int get_src_complexity( string $table, string $fieldname )
|
|
Get src complexity of the relation.
This is just read from the definitions table
|
Parameter |
|
string |
$table |
|
|
the table the foreign key is in |
|
|
string |
$fieldname |
|
|
the name of the foreign key |
|
Returns |
int : The complexity (UML term) on the src of the relationship.
"1", if not defined. |
|
get_zero_src_complexity_text |
public string get_zero_src_complexity_text( string $table, string $fieldname )
|
|
Get src complexity text
Just read from the table.Returns the text for the 0-complexity of the relation on the fkey side and "-- none --" if notdefined
|
Parameter |
|
string |
$table |
|
|
the table the foreign key is in |
|
|
string |
$fieldname |
|
|
the name of the foreign key |
|
Returns |
string : The text which is displayed in the select-tag for "0" complexity |
|
get_filter |
public array get_filter( string $table, string $fieldname, $datarow )
|
|
Returns the filter definitions for the relationship.
|
Parameter |
|
string |
$table |
|
|
: the table the foreign key is in |
|
|
string |
$fieldname |
|
|
: the name of the foreign key |
|
|
|
$datarow |
|
|
Warning: documentation is missing. |
|
Returns |
array $datarow : Returns the filter for a foreign key table |
|