propel-map
[ class tree: propel-map ] [ index: propel-map ] [ all elements ]

Class: TableMap

Source Location: /map/TableMap.php

Class Overview


TableMap is used to model a table in a database.


Author(s):

Version:

  • $Revision: 563 $

Methods



Class Details

[line 44]
TableMap is used to model a table in a database.

GENERAL NOTE ------------ The propel.map classes are abstract building-block classes for modeling the database at runtime. These classes are similar (a lite version) to the propel.engine.database.model classes, which are build-time modeling classes. These classes in themselves do not do any database metadata lookups, but instead are used by the MapBuilder classes that were generated for your datamodel. The MapBuilder that was created for your datamodel build a representation of your database by creating instances of the DatabaseMap, TableMap, ColumnMap, etc. classes. See propel/templates/om/php5/MapBuilder.tpl and the classes generated by that template for your datamodel to further understand how these are put together.




Tags:

author:  Hans Lellelid <hans@xmpl.org> (Propel)
author:  John D. McNally <jmcnally@collab.net> (Torque)
author:  Daniel Rall <dlr@finemaltcoding.com> (Torque)
version:  $Revision: 563 $


[ Top ]


Class Methods


constructor __construct [line 79]

TableMap __construct( string $tableName, DatabaseMap $containingDB)

Construct a new TableMap.



Tags:

access:  public


Parameters:

string   $tableName   The name of the table.
DatabaseMap   $containingDB   A DatabaseMap that this table belongs to.

[ Top ]

method addColumn [line 327]

ColumnMap addColumn( string $name, $phpName, string $type, [boolean $isNotNull = false], [int $size = null], [boolean $pk = null], [$fkColumn $fkTable = null], [ $fkColumn = null], string $defaultValue)

Add a column to the table.



Tags:

return:  The newly created column.
access:  public


Parameters:

string   $type   A string specifying the Propel type.
boolean   $isNotNull   Whether column does not allow NULL values.
int   $size   An int specifying the size.
boolean   $pk   True if column is a primary key.
$fkColumn   $fkTable   A String with the foreign key column name.
string   $defaultValue   The default value for this column.
string   $name   name A String with the column name.
   $phpName  
   $fkColumn  

[ Top ]

method addConfiguredColumn [line 308]

ColumnMap addConfiguredColumn( ColumnMap $cmap)

Add a pre-created column to this table. It will replace any existing column.



Tags:

return:  The added column map.
access:  public


Parameters:

ColumnMap   $cmap   A ColumnMap.

[ Top ]

method addForeignKey [line 279]

ColumnMap addForeignKey( string $columnName, $phpName, string $type, string $fkTable, string $fkColumn, [boolean $isNotNull = false], [int $size = 0], string $defaultValue)

Add a foreign key column to the table.



Tags:

return:  Newly added ForeignKey column.
access:  public


Parameters:

string   $columnName   A String with the column name.
string   $type   A string specifying the Propel type.
string   $fkTable   A String with the foreign key table name.
string   $fkColumn   A String with the foreign key column name.
boolean   $isNotNull   Whether column does not allow NULL values.
int   $size   An int specifying the size.
string   $defaultValue   The default value for this column.
   $phpName  

[ Top ]

method addForeignPrimaryKey [line 296]

ColumnMap addForeignPrimaryKey( string $columnName, $phpName, string $type, string $fkTable, string $fkColumn, [boolean $isNotNull = false], [int $size = 0], string $defaultValue)

Add a foreign primary key column to the table.



Tags:

return:  Newly created foreign pkey column.
access:  public


Parameters:

string   $columnName   A String with the column name.
string   $type   A string specifying the Propel type.
string   $fkTable   A String with the foreign key table name.
string   $fkColumn   A String with the foreign key column name.
boolean   $isNotNull   Whether column does not allow NULL values.
int   $size   An int specifying the size.
string   $defaultValue   The default value for this column.
   $phpName  

[ Top ]

method addPrimaryKey [line 262]

ColumnMap addPrimaryKey( string $columnName, $phpName, string $type, [$size $isNotNull = false], [ $size = null])

Add a primary key column to this Table.



Tags:

return:  Newly added PrimaryKey column.
access:  public


Parameters:

string   $columnName   A String with the column name.
string   $type   A string specifying the Propel type.
$size   $isNotNull   An int specifying the size.
   $phpName  
   $size  

[ Top ]

method addValidator [line 360]

void addValidator( string $columnName, string $name, string $classname, string $value, string $message)

Add a validator to a table's column



Tags:

access:  public


Parameters:

string   $columnName   The name of the validator's column
string   $name   The rule name of this validator
string   $classname   The dot-path name of class to use (e.g. myapp.propel.MyValidator)
string   $value  
string   $message   The error message which is returned on invalid values

[ Top ]

method containsColumn [line 105]

boolean containsColumn( string $name)

Does this table contain the specified column?



Tags:

return:  True if the table contains the column.
access:  public


Parameters:

string   $name   name of the column

[ Top ]

method getClassname [line 179]

string getClassname( )

Get the Classname of the Propel-Classes belonging to this table.



Tags:

access:  public


[ Top ]

method getColumn [line 244]

ColumnMap getColumn( string $name)

Get a ColumnMap for the named table.



Tags:

return:  A ColumnMap.
throws:  PropelException if the column is undefined
access:  public


Parameters:

string   $name   A String with the name of the table.

[ Top ]

method getColumns [line 232]

array getColumns( )

Get a ColumnMap[] of the columns in this table.



Tags:

return:  A ColumnMap[].
access:  public


[ Top ]

method getDatabaseMap [line 118]

DatabaseMap getDatabaseMap( )

Get the DatabaseMap containing this TableMap.



Tags:

return:  A DatabaseMap.
access:  public


[ Top ]

method getName [line 128]

string getName( )

Get the name of the Table.



Tags:

return:  A String with the name of the table.
access:  public


[ Top ]

method getPhpName [line 138]

string getPhpName( )

Get the PHP name of the Table.



Tags:

return:  A String with the name of the table.
access:  public


[ Top ]

method getPrefix [line 158]

string getPrefix( )

Get table prefix name.



Tags:

return:  A String with the prefix.
access:  public


[ Top ]

method getPrimaryKeyColumns [line 216]

array getPrimaryKeyColumns( )

Returns array of ColumnMap objects that make up the primary key for this table.



Tags:

return:  ColumnMap[]
access:  public


[ Top ]

method getPrimaryKeyMethodInfo [line 207]

An getPrimaryKeyMethodInfo( )

Get the information used to generate a primary key



Tags:

return:  Object.
access:  public


[ Top ]

method isUseIdGenerator [line 198]

boolean isUseIdGenerator( )

Whether to use Id generator for primary key.



Tags:

access:  public


[ Top ]

method removeUnderScores [line 430]

string removeUnderScores( data $data)

Removes the PREFIX, removes the underscores and makes first letter caps.

SCARAB_FOO_BAR becomes FooBar.




Tags:

return:  A String with data processed.
access:  public


Parameters:

data   $data   A String.

[ Top ]

method setClassname [line 189]

void setClassname( string $classname)

Set the Classname of the Table. Could be useful for calling Peer and Object methods dynamically.



Tags:

access:  public


Parameters:

string   $classname   The Classname

[ Top ]

method setPhpName [line 148]

void setPhpName( string $phpName)

Set the PHP name of the Table.



Tags:

access:  public


Parameters:

string   $phpName   The PHP Name for this table

[ Top ]

method setPrefix [line 170]

void setPrefix( string $prefix)

Set table prefix name.



Tags:

access:  public


Parameters:

string   $prefix   The prefix for the table name (ie: SCARAB for SCARAB_PROJECT).

[ Top ]

method setPrimaryKeyMethodInfo [line 390]

void setPrimaryKeyMethodInfo( $pkInfo $pkInfo)

Sets the pk information needed to generate a key



Tags:

access:  public


Parameters:

$pkInfo   $pkInfo   information needed to generate a key

[ Top ]

method setUseIdGenerator [line 381]

void setUseIdGenerator( boolean $bit)

Set whether or not to use Id generator for primary key.



Tags:

access:  public


Parameters:

boolean   $bit  

[ Top ]


Documentation generated on Thu, 22 Nov 2007 03:33:55 +0000 by phpDocumentor 1.4.0