Class SchemaTable

Description

SchemaTable contains information about one table (its columns).

  • author: Anthony Bush

Located in /schema/SchemaTable.class.php (line 9)


	
			
Direct descendents
Class Description
MysqlTable Implements the interface for Table Driver, which:
Variable Summary
Method Summary
void addColumn ( $column)
void addForeignKey (SchemaForeignKey $foreignKey)
void addHabtmRelationshis ( $habtmRelationship)
void addHasManyRelationship ( $hasManyRelationship)
void addHasOneRelationship ( $hasOneRelationship)
void getColumn ( $columnName)
void getColumns ()
void getDatabase ()
mixed getForeignKey (SchemaForeignKey $foreignKeyNeedle)
void getForeignKeys ()
void getPrimaryKey ()
void getSchema ()
void getTableName ()
bool hasForeignKey (SchemaForeignKey $foreignKeyNeedle)
void hasPrimaryKey ()
void setDatabase ( $database)
void setTableName ( $tableName)
Variables
mixed $columns = array() (line 13)
  • access: protected
mixed $database = null (line 11)
  • access: protected
array $foreignKeys = array() (line 26)

Format of

array( 'local_key' => array('col_name1'[, 'col_name2']*), 'ref_table' => 'ref_table_name', 'ref_database' => 'ref_database_name', // optional, only required if the database that the ref_table is on a different database than the local table 'ref_key' => array('ref_col_name1'[, 'ref_col_name2']*) )

  • access: protected
array $habtmRelationships = array() (line 47)

many-to-many relationships (habtm = has and belongs to many)

  • access: protected
array $hasManyRelationships = array() (line 40)

one-to-many relationships

  • access: protected
array $hasOneRelationships = array() (line 33)

one-to-one relationships

  • access: protected
mixed $tableName = null (line 12)
  • access: protected
Methods
addColumn (line 120)
  • access: public
void addColumn ( $column)
  • $column
addForeignKey (line 131)

Add a foreign key hash to the table.

void addForeignKey (SchemaForeignKey $foreignKey)
addHabtmRelationshis (line 177)
  • access: public
void addHabtmRelationshis ( $habtmRelationship)
  • $habtmRelationship
addHasManyRelationship (line 173)
  • access: public
void addHasManyRelationship ( $hasManyRelationship)
  • $hasManyRelationship
addHasOneRelationship (line 169)
  • access: public
void addHasOneRelationship ( $hasOneRelationship)
  • $hasOneRelationship
getColumn (line 67)
  • access: public
void getColumn ( $columnName)
  • $columnName
getColumns (line 63)
  • access: public
void getColumns ()
getDatabase (line 55)
  • access: public
void getDatabase ()
getForeignKey (line 160)

Returns the existing foreign key (with same local key name) if one exists, otherwise returns null.

  • return: - SchemaForeignKey if found, null if not.
  • author: Anthony Bush
  • access: public
mixed getForeignKey (SchemaForeignKey $foreignKeyNeedle)
getForeignKeys (line 94)
  • access: public
void getForeignKeys ()
getHabtmRelationships (line 106)
  • access: public
void getHabtmRelationships ()
getHasManyRelationships (line 102)
  • access: public
void getHasManyRelationships ()
getHasOneRelationships (line 98)
  • access: public
void getHasOneRelationships ()
getPrimaryKey (line 75)
  • access: public
void getPrimaryKey ()
getSchema (line 51)
  • access: public
void getSchema ()
getTableName (line 59)
  • access: public
void getTableName ()
hasForeignKey (line 144)

Check if the specified foreign key already exists (by comparing it's local key name)

  • return: - true if the specified foreign key already exists, false if not
  • author: Anthony Bush
  • access: public
bool hasForeignKey (SchemaForeignKey $foreignKeyNeedle)
hasPrimaryKey (line 85)
  • access: public
void hasPrimaryKey ()
setDatabase (line 112)
  • access: public
void setDatabase ( $database)
  • $database
setTableName (line 116)
  • access: public
void setTableName ( $tableName)
  • $tableName

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