Propel 2 API
Class

Propel\Runtime\Map\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.

setPhpName(string $phpName)

Set the php name of this column.

string getPhpName()

Get the name of a column.

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 isNumeric()

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

boolean isText()

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

setSize(int $size)

Set the size of this column.

int getSize()

Get the size of this column.

setPrimaryKey(boolean $pk)

Set if this column is a primary key or not.

boolean isPrimaryKey()

Is this column a primary key?

setNotNull(Boolean $nn)

Set if this column may be null.

boolean isNotNull()

Is null value allowed ?

setDefaultValue(mixed $defaultValue)

Sets the default value for this column.

mixed getDefaultValue()

Gets the default value for this column.

setForeignKey(string $tableName, string $columnName)

Set the foreign key for this column.

boolean isForeignKey()

Is this column a foreign key?

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.

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)

ignoreCase(string $str, AdapterInterface $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?

Details

at line 106
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 117
public string getName()

Get the name of a column.

Return Value

string A String with the column name.

at line 127
public TableMap getTable()

Get the table map this column belongs to.

Return Value

TableMap

at line 137
public string getTableName()

Get the name of the table this column is in.

Return Value

string A String with the table name.

at line 147
public string getFullyQualifiedName()

Get the table name + column name.

Return Value

string A String with the full column name.

at line 157
public setPhpName(string $phpName)

Set the php name of this column.

Parameters

string $phpName A string representing the PHP name.

at line 167
public string getPhpName()

Get the name of a column.

Return Value

string A String with the column name.

at line 177
public setType(string $type)

Set the Propel type of this column.

Parameters

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

at line 187
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 197
public int getPdoType()

Get the PDO type of this column.

Return Value

int The PDO::PARAM_* value

at line 207
public boolean isLob()

Whether this is a BLOB, LONGVARBINARY, or VARBINARY.

Return Value

boolean

at line 221
public boolean isTemporal()

Whether this is a DATE/TIME/TIMESTAMP column.

Return Value

boolean

at line 237
public boolean isNumeric()

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

Return Value

boolean

at line 257
public boolean isText()

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

Return Value

boolean

at line 271
public setSize(int $size)

Set the size of this column.

Parameters

int $size An int specifying the size.

at line 281
public int getSize()

Get the size of this column.

Return Value

int An int specifying the size.

at line 291
public setPrimaryKey(boolean $pk)

Set if this column is a primary key or not.

Parameters

boolean $pk True if column is a primary key.

at line 301
public boolean isPrimaryKey()

Is this column a primary key?

Return Value

boolean True if column is a primary key.

at line 311
public setNotNull(Boolean $nn)

Set if this column may be null.

Parameters

Boolean $nn nn True if column may be null.

at line 321
public boolean isNotNull()

Is null value allowed ?

Return Value

boolean True if column may not be null.

at line 331
public setDefaultValue(mixed $defaultValue)

Sets the default value for this column.

Parameters

mixed $defaultValue the default value for the column

at line 340
public mixed getDefaultValue()

Gets the default value for this column.

Return Value

mixed String or NULL

at line 351
public 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.

at line 368
public boolean isForeignKey()

Is this column a foreign key?

Return Value

boolean True if column is a foreign key.

at line 376
public getRelation()

Get the RelationMap object for this foreign key

at line 397
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 407
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 417
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 428
public TableMap getRelatedTable()

Get the TableMap object that this column is related to.

Return Value

TableMap The related TableMap object

Exceptions

ForeignKeyNotFoundException when called on a column with no foreign key

at line 443
public ColumnMap getRelatedColumn()

Get the TableMap object that this column is related to.

Return Value

ColumnMap The related ColumnMap object

Exceptions

ForeignKeyNotFoundException when called on a column with no foreign key

at line 453
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 463
public array getValueSet()

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

Return Value

array A list of allowed values

at line 468
public isInValueSet($value)

Parameters

$value

at line 473
public getValueSetKey($value)

Parameters

$value

at line 484
public ignoreCase(string $str, AdapterInterface $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).
AdapterInterface $db

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

Normalizes the column name, removing table prefix and uppercasing.

article.first_name becomes FIRST_NAME

Parameters

string $name

Return Value

string Normalized column name.

at line 515
public setPrimaryString(boolean $pkString)

Set this column to be a primaryString column.

Parameters

boolean $pkString

at line 525
public boolean isPrimaryString()

Is this column a primaryString column?

Return Value

boolean True, if this column is the primaryString column.