print dbMapperTableDefinition

Holds properties about a table; largely based on MySQL table definition. A table definition contains dbMapperFieldSet and dbMapperIndexSet which in-turn hold the information about the fields and the indexes that make up the table.

All of these properties can be specified manually by chaining together the method calls. An example of this can be seen in the test cases for testing these classes. Under normal circumstances they are auto-populated via the dbDrivers utility class.

$oTable = new dbMapperTableDefinition('testdb', 'test');
$oTable
    ->setIndexes(
        dbMapperIndexSet::getInstance()
            ->addIndexDefinition(new dbMapperIndexDefinition())
            ->addIndexDefinition(new dbMapperIndexDefinition())
    )
    ->setFields(
        dbMapperFieldSet::getInstance()
            ->addFieldDefinition(new dbMapperFieldDefinition())
            ->addFieldDefinition(new dbMapperFieldDefinition())
    );

Methods

public static getInstance($inDatabase, $inTableName)

Returns a new instance of dbMapperTableDefinition

public __construct([$inDatabase = null], [$inTableName = null])

Returns a new table definition

public getIndexes()

Returns Indexes

public setIndexes($dbIndexSet)

Set Indexes property

public getFields()

Returns Fields

public setFields($dbFieldSet)

Set Fields property

public getTableName()

Returns TableName

public setTableName($inTableName)

Set TableName property

public getDatabase()

Returns Database

public setDatabase($inDatabase)

Set Database property

public getField($inFieldName)

Returns a field named $inFieldName, or false if not found

public getNonUniqueFields()

Returns fields that are NOT in a primary or unique key

<  1  >