Class SchemaManipulator

Description

Takes a schema (and config) and runs through the schema in an effort to detect foreign keys that may have been missed (or simply weren't specified at the database level).

  • author: Anthony Bush

Located in /schema/SchemaManipulator.class.php (line 11)


	
			
Variable Summary
Method Summary
void __construct ([mixed $config = array()])
void disableVerbose ()
void enableVerbose ()
mixed findTable ( $tableNameMatch, SchemaTable $sourceTable)
mixed findTableInDatabase ( $tableNameMatch, SchemaDatabase $database)
void initConfig ( $config)
void manipulateSchema ( $schema)
Variables
DatabaseSchemaGeneratorConfig $config = null (line 18)

Configuration object for this class

  • access: protected
mixed $debug = false (line 26)
  • access: protected
Schema $schema = null (line 33)

A reference to the schema to manipulate

  • access: protected
boolean $verbose = false (line 25)

Whether or not to echo what's happening to the screen.

  • access: protected
Methods
Constructor __construct (line 41)

Construct with optional configuration parameters.

  • access: public
void __construct ([mixed $config = array()])
  • mixed $config: - either an array of configuration variables or a pre-constructed DatabaseSchemaGeneratorConfig object.
disableVerbose (line 78)

Disable verbose mode

void disableVerbose ()
enableVerbose (line 68)

Enable verbose mode

void enableVerbose ()
findTable (line 189)

Scans the schema for the specified table name (or prefix + table name), starting with the given database and only scanning other databases if the table is not found there.

  • return: - SchemaTable if found, null if not
  • author: Anthony Bush
  • access: protected
mixed findTable ( $tableNameMatch, SchemaTable $sourceTable)
findTableInDatabase (line 222)

Scans the specified database for the specified table name (using the match_table_name_prefixes config setting to scan for more table names in the event the given one is not found.)

This is support method for findTable().

  • return: - SchemaTable if found, null if not.
  • author: Anthony Bush
  • access: protected
mixed findTableInDatabase ( $tableNameMatch, SchemaDatabase $database)
initConfig (line 52)

Initialize the configuration object given an array or pre-constructed configuration object.

  • throws: Exception
  • access: public
void initConfig ( $config)
  • $config
manipulateSchema (line 93)

Scans the schema and manipulates it by detecting FKs adding them to tables.

It uses the id_to_table_regex config setting to find columns that might be FKs, and uses match_table_name_prefixes to assist in locating a table that matches the FK column name.

  • author: Anthony Bush
  • access: public
void manipulateSchema ( $schema)
  • $schema

Documentation generated on Wed, 12 Nov 2008 21:56:21 -0600 by phpDocumentor 1.4.0