Class

ColumnMap

class ColumnMap

ColumnMap is used to model a column of 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.

Methods

__construct(string $name, TableMap $containingTable)

Constructor.

string getName()

Get the name of a column.

TableMap getTable()

Get the table map this column belongs to.

string getTableName()

Get the name of the table this column is in.

string getFullyQualifiedName()

Get the table name + column name.

void setPhpName(string $phpName)

Set the php name of this column.

string getPhpName()

Get the name of a column.

void setType(string $type)

Set the Propel type of this column.

string getType()

Get the Propel type of this column.

int getPdoType()

Get the PDO type of this column.

boolean isLob()

Whether this is a BLOB, LONGVARBINARY, or VARBINARY.

boolean isTemporal()

Whether this is a DATE/TIME/TIMESTAMP column.

boolean isEpochTemporal()

Whether this is a DATE/TIME/TIMESTAMP column that is post-epoch (1970).

boolean isNumeric()

Whether this column is numeric (int, decimal, bigint etc).

boolean isInteger()

Whether this column is an integer

boolean isText()

Whether this column is a text column (varchar, char, longvarchar).

void setSize(int $size)

Set the size of this column.

int getSize()

Get the size of this column.

void setPrimaryKey(boolean $pk)

Set if this column is a primary key or not.

boolean isPrimaryKey()

Is this column a primary key?

void setNotNull(boolean $nn)

Set if this column may be null.

boolean isNotNull()

Is null value allowed ?

void setDefaultValue(mixed $defaultValue)

Sets the default value for this column.

mixed getDefaultValue()

Gets the default value for this column.

void setForeignKey(string $tableName, string $columnName)

Set the foreign key for this column.

boolean isForeignKey()

Is this column a foreign key?

RelationMap|null getRelation()

Get the RelationMap object for this foreign key

string getRelatedName()

Get the table.column that this column is related to.

string getRelatedTableName()

Get the table name that this column is related to.

string getRelatedColumnName()

Get the column name that this column is related to.

TableMap getRelatedTable()

Get the TableMap object that this column is related to.

ColumnMap getRelatedColumn()

Get the TableMap object that this column is related to.

addValidator($validator)

hasValidators()

getValidators()

setValueSet(array $values)

Set the valueSet of this column (only valid for ENUM columns).

array getValueSet()

Get the valueSet of this column (only valid for ENUM columns).

isInValueSet($value)

getValueSetKey($value)

string ignoreCase(string $str, DBAdapter $db)

Performs DB-specific ignore case, but only if the column type necessitates it.

static string normalizeName(string $name)

Normalizes the column name, removing table prefix and uppercasing.

setPrimaryString(boolean $pkString)

Set this column to be a primaryString column.

boolean isPrimaryString()

Is this column a primaryString column?

string getColumnName()

Gets column name

Details

at line 74
public __construct(string $name, TableMap $containingTable)

Constructor.

Parameters

string $name The name of the column.
TableMap $containingTable containingTable TableMap of the table this column is in.

at line 85
public string getName()

Get the name of a column.

Return Value

string A String with the column name.

at line 95
public TableMap getTable()

Get the table map this column belongs to.

Return Value

TableMap

at line 105
public string getTableName()

Get the name of the table this column is in.

Return Value

string A String with the table name.

at line 115
public string getFullyQualifiedName()

Get the table name + column name.

Return Value

string A String with the full column name.

at line 127
public void setPhpName(string $phpName)

Set the php name of this column.

Parameters

string $phpName A string representing the PHP name.

Return Value

void

at line 137
public string getPhpName()

Get the name of a column.

Return Value

string A String with the column name.

at line 149
public void setType(string $type)

Set the Propel type of this column.

Parameters

string $type A string representing the Propel type (e.g. PropelColumnTypes::DATE).

Return Value

void

at line 159
public string getType()

Get the Propel type of this column.

Return Value

string A string representing the Propel type (e.g. PropelColumnTypes::DATE).

at line 169
public int getPdoType()

Get the PDO type of this column.

Return Value

int The PDO::PARMA_* value

at line 179
public boolean isLob()

Whether this is a BLOB, LONGVARBINARY, or VARBINARY.

Return Value

boolean

at line 190
public boolean isTemporal()

Whether this is a DATE/TIME/TIMESTAMP column.

Return Value

boolean

at line 204
public boolean isEpochTemporal()

Whether this is a DATE/TIME/TIMESTAMP column that is post-epoch (1970).

PHP cannot handle pre-epoch timestamps well -- hence the need to differentiate between epoch and pre-epoch timestamps.

Return Value

boolean

at line 214
public boolean isNumeric()

Whether this column is numeric (int, decimal, bigint etc).

Return Value

boolean

at line 224
public boolean isInteger()

Whether this column is an integer

Return Value

boolean

at line 234
public boolean isText()

Whether this column is a text column (varchar, char, longvarchar).

Return Value

boolean

at line 246
public void setSize(int $size)

Set the size of this column.

Parameters

int $size An int specifying the size.

Return Value

void

at line 256
public int getSize()

Get the size of this column.

Return Value

int An int specifying the size.

at line 268
public void setPrimaryKey(boolean $pk)

Set if this column is a primary key or not.

Parameters

boolean $pk True if column is a primary key.

Return Value

void

at line 278
public boolean isPrimaryKey()

Is this column a primary key?

Return Value

boolean True if column is a primary key.

at line 290
public void setNotNull(boolean $nn)

Set if this column may be null.

Parameters

boolean $nn nn True if column may be null.

Return Value

void

at line 300
public boolean isNotNull()

Is null value allowed ?

Return Value

boolean True if column may not be null.

at line 312
public void setDefaultValue(mixed $defaultValue)

Sets the default value for this column.

Parameters

mixed $defaultValue the default value for the column

Return Value

void

at line 322
public mixed getDefaultValue()

Gets the default value for this column.

Return Value

mixed String or NULL

at line 335
public void setForeignKey(string $tableName, string $columnName)

Set the foreign key for this column.

Parameters

string $tableName tableName The name of the table that is foreign.
string $columnName columnName The name of the column that is foreign.

Return Value

void

at line 351
public boolean isForeignKey()

Is this column a foreign key?

Return Value

boolean True if column is a foreign key.

at line 365
public RelationMap|null getRelation()

Get the RelationMap object for this foreign key

Return Value

RelationMap|null

at line 384
public string getRelatedName()

Get the table.column that this column is related to.

Return Value

string A String with the full name for the related column.

at line 394
public string getRelatedTableName()

Get the table name that this column is related to.

Return Value

string A String with the name for the related table.

at line 404
public string getRelatedColumnName()

Get the column name that this column is related to.

Return Value

string A String with the name for the related column.

at line 415
public TableMap getRelatedTable()

Get the TableMap object that this column is related to.

Return Value

TableMap The related TableMap object

Exceptions

PropelException when called on a column with no foreign key

at line 430
public ColumnMap getRelatedColumn()

Get the TableMap object that this column is related to.

Return Value

ColumnMap The related ColumnMap object

Exceptions

PropelException when called on a column with no foreign key

at line 435
public addValidator($validator)

Parameters

$validator

at line 440
public hasValidators()

at line 445
public getValidators()

at line 455
public setValueSet(array $values)

Set the valueSet of this column (only valid for ENUM columns).

Parameters

array $values A list of allowed values

at line 465
public array getValueSet()

Get the valueSet of this column (only valid for ENUM columns).

Return Value

array A list of allowed values

at line 470
public isInValueSet($value)

Parameters

$value

at line 475
public getValueSetKey($value)

Parameters

$value

at line 488
public string ignoreCase(string $str, DBAdapter $db)

Performs DB-specific ignore case, but only if the column type necessitates it.

Parameters

string $str The expression we want to apply the ignore case formatting to (e.g. the column name).
DBAdapter $db

Return Value

string

at line 506
static public string normalizeName(string $name)

Normalizes the column name, removing table prefix and uppercasing.

article.firstname becomes firstname

Parameters

string $name

Return Value

string Normalized column name.

at line 520
public setPrimaryString(boolean $pkString)

Set this column to be a primaryString column.

Parameters

boolean $pkString

at line 530
public boolean isPrimaryString()

Is this column a primaryString column?

Return Value

boolean True, if this column is the primaryString column.

at line 544
public string getColumnName()

Gets column name

Return Value

string