Packageindex Classtrees Modulegroups Elementlist Report XML Files

pxdb.metadata

pxdb_basis

pxdb_basis

public class pxdb_basis

This is the most generic/general purpose of the metadata classes. This class instantiates via the fetch_*() methods the other metadata objects. In addition to instantiating other classes, this class contains the methods that manage macro-level metadata.

AuthorsHans Lellelid <hans@velum.net>
Version$Revision: 1.3 $

 
Direct known subclasses: pxdb_datatype, pxdb_dbfield, pxdb_relationship, pxdb_typesfield, pxdb_view, pxdb_viewfield

Public Method Summary

void pxdb_basis()
Calls parent constructor.
void load(string $table)
Loads vars from global scope into current class.
object the &fetch_datatype( $reset)
Fetch all datatypes rows and instantiate as pxdb_datatype objects.
object the &fetch_relationship( $reset)
Fetch all relationships rows and instantiate as pxdb_relationship objects.
object the &fetch_dbfield( $reset)
Fetch all dbfields rows and instantiate as pxdb_dbfield objects.
object the &fetch_typesfield(object we $dt, $reset)
Fetch all typesfields rows and instantiate as pxdb_typesfield objects.
object the &fetch_view(object we $dt, $reset)
Fetch all views rows and instantiate as pxdb_view objects.
object the &fetch_viewfield(object we $v, $reset)
Fetch all viewfields rows and instantiate as pxdb_viewfield objects.
array arr_dbfields([ string $mask ])
Get a list of dbfields for this pxdb instance.
void arr_datatypes([ string $mask, string $constraint_sql, string $orderby ])
Get all datatypes for this pxdb instance.
void arr_parent_datatypes(integer $dt, [ string $mask, string $constraint_sql ])
Get all parent datatypes for a given datatype.
void arr_child_datatypes(integer $dt, [ string $mask, string $constraint_sql ])
Get all child datatypes for a given datatype.
array arr_relationships([ string $mask, string $constraint_sql ])
Gets the relationships for this pxdb instance.
array arr_typesfields(integer $dt, [ string $mask, string $constraint_sql ])
Gets the relationships for this pxdb instance.
void arr_views(integer $dt, [ string $mask, string $constraint_sql ])
Get all views for a specific datatype.
void arr_viewfields(integer $v, [ string $mask, string $constraint_sql ])
Get all viewfields for a specific view.

Private Method Summary

void import([ array $source ])
Performs the basic task of loading data into the $_imported var.
void reorder(array $params)
Abstract function for re-ordering weighted rows.
boolean move(array $params)
Abstract function for promoting or demoting a row.
Array get_groups()
Gets the groups from the database.
Array get_users()
Gets the users from the database.

Public Field Summary

boolean $debug
Debug switch.
array $errors
Errors array.

Private Field Summary

array $_imported
Vars imported from global / $_REQUEST scope.
array $_fields
Fields array (used by subclasses).
array $_old_fields
Array of fields load().
string $method

Public Method Details

pxdb_basis

public void pxdb_basis()

 

Returns void


load

public void load(string $table)

  Uses the set_*() methods of the current class to load values for every column of table -- if that value is in the $_imported array.

Parameter
string $table
The table for which to load values.
Returns void


&fetch_datatype

public object the &fetch_datatype( $reset)

 

Parameter
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_datatype object.


&fetch_relationship

public object the &fetch_relationship( $reset)

 

Parameter
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_relationship object.


&fetch_dbfield

public object the &fetch_dbfield( $reset)

 

Parameter
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_dbfield object.


&fetch_typesfield

public object the &fetch_typesfield(object we $dt, $reset)

 

Parameter
object we $dt
are working with.
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_typesfield object.


&fetch_view

public object the &fetch_view(object we $dt, $reset)

 

Parameter
object we $dt
are working with.
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_typesfield object.


&fetch_viewfield

public object the &fetch_viewfield(object we $v, $reset)

 

Parameter
object we $v
are working with.
$reset
Warning: documentation is missing.
Returns object the

instantiated pxdb_typesfield object.


arr_dbfields

public array arr_dbfields([ string $mask ])

 

Parameter
string $mask = >>''<<
The value to return for custom_field.
Returns array

dbfields .


arr_datatypes

public void arr_datatypes([ string $mask, string $constraint_sql, string $orderby ])

 

Parameter
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
string $orderby = >>'weight'<<
by fields(s), defaults to weight
Returns void


arr_parent_datatypes

public void arr_parent_datatypes(integer $dt, [ string $mask, string $constraint_sql ])

 

Parameter
integer $dt
Datatype
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns void


arr_child_datatypes

public void arr_child_datatypes(integer $dt, [ string $mask, string $constraint_sql ])

 

Parameter
integer $dt
Datatype
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns void


arr_relationships

public array arr_relationships([ string $mask, string $constraint_sql ])

 

Parameter
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns array

relid and description of relationships.


arr_typesfields

public array arr_typesfields(integer $dt, [ string $mask, string $constraint_sql ])

 

Parameter
integer $dt
Datatype to fetch typesfields for.
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns array

relid and description of relationships.


arr_views

public void arr_views(integer $dt, [ string $mask, string $constraint_sql ])

 

Parameter
integer $dt
The datatype for which to fetch views.
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns void


arr_viewfields

public void arr_viewfields(integer $v, [ string $mask, string $constraint_sql ])

 

Parameter
integer $v
The datatype for which to fetch views.
string $mask = >>''<<
The value to return for custom_field.
string $constraint_sql = >>null<<
WHERE-clause SQL to constrain results.
Returns void


Private Method Details

import

private void import([ array $source ])

  Sub-classes that override this method should always provide this minimal function signature and should begin by invoke the parent import() method.

Parameter
array $source = >>null<<
The source values to import.
Returns void


reorder

private void reorder(array $params)

  This function goes through the table assigning weights of interval 5 to all the rows matching constraints.

Parameter
array $params
Hash of variables needed: table, id, dir, id_col, weight_col, constraint_sql.
Returns void


move

private boolean move(array $params)

 

Parameter
array $params
Hash of variables needed: table, id, dir, id_col, weight_col, constraint_sql.
Returns boolean

True or False on success of move.


get_groups

private Array get_groups()

  As specified by the group_dt values in preferences table.

Returns Array

of id and gname for all groups.


get_users

private Array get_users()

  As specified by the user_dt values in preferences table.

Returns Array

of id and uname for all users.


Public Field Details

$debug

public boolean $debug

>><<


$errors

public array $errors

>><<


Private Field Details

$_imported

private array $_imported

>><<


$_fields

private array $_fields

>><<


$_old_fields

private array $_old_fields

>><<


$method

private string $method

>>'set_'<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Fri, 28 Apr 2006 19:07:22 -0400 by PHPDoc v1.5 www.phpdoc.de