Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
Public Member Functions | Data Fields
Dataface_MetadataTool Class Reference

Public Member Functions

 Dataface_MetadataTool ($tablename)
 isMetadataTable ($tablename=null)
getColumns ($tablename=null, $usecache=true)
getKeyColumns ($tablename=null, $usecache=true)
 loadMetadataFieldDefs ($tablename=null)
 createMetadataTable ($tablename=null)
 refreshMetadataTable ($tablename=null)

Data Fields

 $fieldDefs = null
 $tablename = null
 $columns = null
 $keyColumns = null

Detailed Description

A tool for managing table metadata. Meta data can be any data that describes a record but is not part of the record itself. This is handy for storing workflow information about records such as translation status. Generally metadata for a given table is stored in a separate table named tablename__metadata where 'tablename' is the name of the table described by the metadata.

Author
Steve Hannah (shann.nosp@m.ah@s.nosp@m.fu.ca) August 29, 2006

Definition at line 14 of file MetadataTool.php.

Member Function Documentation

createMetadataTable (   $tablename = null)

Creates a table to store the metadata for the given table.

Parameters
string$tablenameThe name of the table for which the metadata is to be stored.
Returns
boolean True if the table is created.. false otherwise.

Definition at line 143 of file MetadataTool.php.

Dataface_MetadataTool (   $tablename)

Definition at line 39 of file MetadataTool.php.

& getColumns (   $tablename = null,
  $usecache = true 
)

Gets the column definitions of the metadata table as produced by show columns SQL query.

Parameters
string$tablenameThe name of the subject table.
boolean$usecacheWhether to use cached results or to forcefully obtain up-to-date data.
Returns
array Associative array of column definitions.

Definition at line 61 of file MetadataTool.php.

& getKeyColumns (   $tablename = null,
  $usecache = true 
)

Returns the columns of this metadata table that are part of the primary key.

Parameters
string$tablenameThe name of the subject table.
boolean$usecacheWhether to use cached results or to force a new call to show columns
Returns
array Associative array of primary key columns with key=name, value=associative array.

Definition at line 88 of file MetadataTool.php.

isMetadataTable (   $tablename = null)

Checks a table name to see if it is a metadata table. A metadata table always ends in '__metadata'.

Parameters
string$tablenameThe name of the table to check.
Returns
boolean

Definition at line 49 of file MetadataTool.php.

loadMetadataFieldDefs (   $tablename = null)

Loads the field definitions for meta data for the given table. These are defined in the metadata.ini files at the table, application, and dataface levels.

Definition at line 112 of file MetadataTool.php.

refreshMetadataTable (   $tablename = null)

Refreshes the metadata table for a given table. This means that missing columns and keys are created so that the schema matches the schema of the current table structure.

Parameters
string$tablenameThe name of the table for which the metadata is being stored.

Definition at line 188 of file MetadataTool.php.

Field Documentation

$columns = null

Definition at line 31 of file MetadataTool.php.

$fieldDefs = null

Definition at line 20 of file MetadataTool.php.

$keyColumns = null

Definition at line 37 of file MetadataTool.php.

$tablename = null

Definition at line 25 of file MetadataTool.php.


The documentation for this class was generated from the following file: