class Column extends MappingModel
A class for holding data about a column used in an application.
Constants
DEFAULT_TYPE |
|
DEFAULT_VISIBILITY |
|
Properties
static | $validVisibilities |
Methods
__construct(string $name = null)
Creates a new column and set the name. |
||
loadMapping(array $attributes)
Loads a mapping definition from an array. |
from MappingModel | |
array |
getAttributes()
Returns all definition attributes. |
from MappingModel |
mixed |
getAttribute(string $name, mixed $default = null)
Returns a particular attribute by a case-insensitive name. |
from MappingModel |
appendXml(DOMNode $node)
Appends DOM elements to represent this object in XML. |
||
VendorInfo |
addVendorInfo(VendorInfo|array $vendor)
Adds a new VendorInfo instance to this current model object. |
from MappingModel |
VendorInfo |
getVendorInfoForType(string $type)
Returns a VendorInfo object by its type. |
from MappingModel |
string |
getConfiguredBehavior(string $behavior)
Returns the best class name for a given behavior. |
from MappingModel |
string |
toString()
String representation of the current object. |
from MappingModel |
string |
__toString()
String representation of the current object. |
from MappingModel |
Domain |
getDomain()
Gets domain for this column, creating a new empty domain object if none is set. |
|
setDomain(Domain $domain)
Sets the domain for this column. |
||
string |
getFullyQualifiedName()
Returns the fully qualified column name (table.column). |
|
string |
getName()
Returns the column name. |
|
setName(string $name)
Sets the column name. |
||
boolean |
isNamePlural()
Returns whether or not the column name is plural. |
|
string |
getSingularName()
Returns the column singular name. |
|
string |
getDescription()
Returns the column description. |
|
setDescription(string $description)
Sets the column description. |
||
string |
getPhpName()
Returns the name to use in PHP sources. |
|
setPhpName(string $phpName = null)
Sets the name to use in PHP sources. |
||
string |
getStudlyPhpName()
Returns the studly version of the PHP name. |
|
string |
getAccessorVisibility()
Returns the accessor methods visibility of this column / attribute. |
|
setAccessorVisibility(string $visibility)
Sets the accessor methods visibility for this column / attribute. |
||
string |
getMutatorVisibility()
Returns the mutator methods visibility for this current column. |
|
setMutatorVisibility(string $visibility)
Sets the mutator methods visibility for this column / attribute. |
||
string |
getConstantName()
Returns the full column constant name (e.g. |
|
string |
getConstantColumnName()
Returns the column constant name. |
|
string |
getTableMapName()
Returns the TableMap constant name that will identify this column. |
|
setTableMapName(string $name)
Sets the TableMap constant name that will identify this column. |
||
string |
getPhpType()
Returns the type to use in PHP sources. |
|
integer |
getPosition()
Returns the location of this column within the table (one-based). |
|
setPosition(integer $position)
Returns the location of this column within the table (one-based). |
||
setTable(Table $table)
Sets the parent table. |
||
Table |
getTable()
Returns the parent table. |
|
string |
getTableName()
Returns the parent table name. |
|
Inheritance |
addInheritance(Inheritance|array $inheritance)
Adds a new inheritance definition to the inheritance list and sets the parent column of the inheritance to the current column. |
|
array |
getChildren()
Returns the inheritance definitions. |
|
boolean |
isInheritance()
Returns whether or not this column is a normal property or specifies a the classes that are represented in the table containing this column. |
|
boolean |
isEnumeratedClasses()
Returns whether or not possible classes have been enumerated in the schema file. |
|
boolean |
isNotNull()
Returns whether or not the column is not null. |
|
setNotNull(boolean $notNull)
Sets whether or not the column is not null. |
||
string. |
getNotNullString()
Returns NOT NULL string for this column. |
|
setPrimaryString(boolean $isPrimaryString)
Sets whether or not the column is used as the primary string. |
||
boolean |
isPrimaryString()
Returns true if the column is the primary string (used for the magic __toString() method). |
|
setPrimaryKey(boolean $primary)
Sets whether or not the column is a primary key. |
||
boolean |
isPrimaryKey()
Returns whether or not the column is the primary key. |
|
setNodeKey(boolean $isNodeKey)
Sets whether or not the column is a node key of a tree. |
||
boolean |
isNodeKey()
Returns whether or not the column is a node key of a tree. |
|
setNodeKeySep(string $sep)
Sets the separator for the node key column in a tree. |
||
string |
getNodeKeySep()
Returns the node key column separator for a tree. |
|
setNestedSetLeftKey(boolean $isNestedSetLeftKey)
Sets whether or not the column is the nested set left key of a tree. |
||
boolean |
isNestedSetLeftKey()
Returns whether or not the column is a nested set key of a tree. |
|
setNestedSetRightKey(boolean $isNestedSetRightKey)
Set if the column is the nested set right key of a tree. |
||
boolean |
isNestedSetRightKey()
Return whether or not the column is a nested set right key of a tree. |
|
setTreeScopeKey(boolean $isTreeScopeKey)
Sets whether or not the column is the scope key of a tree. |
||
boolean |
isTreeScopeKey()
Returns whether or not the column is a scope key of a tree. |
|
setUnique(boolean $isUnique)
Sets whether or not the column must have a unique index on it. |
||
boolean |
isUnique()
Returns whether or not the column must have a unique index. |
|
boolean |
requiresTransactionInPostgres()
Returns true if the column requires a transaction in PostGreSQL. |
|
boolean |
isForeignKey()
Returns whether or not this column is a foreign key. |
|
boolean |
hasMultipleFK()
Returns whether or not this column is part of more than one foreign key. |
|
array |
getForeignKeys()
Returns the foreign key objects for this column. |
|
addReferrer(ForeignKey $fk)
Adds the foreign key from another table that refers to this column. |
||
array |
getReferrers()
Returns the list of references to this column. |
|
boolean |
hasReferrers()
Returns whether or not this column has referers. |
|
boolean |
hasReferrer(ForeignKey $fk)
Returns whether or not this column has a specific referrer for a specific foreign key object. |
|
clearReferrers()
Clears all referrers. |
||
clearInheritanceList()
Clears all inheritance children. |
||
setDomainForType(string $mappingType)
Sets the domain up for specified mapping type. |
||
setType(string $mappingType)
Sets the mapping column type. |
||
string |
getType()
Returns the Propel column type as a string. |
|
integer |
getPDOType()
Returns the column PDO type integer for this column's mapping type. |
|
isDefaultSqlType(PlatformInterface $platform = null) | ||
boolean |
isLobType()
Returns whether or not this column is a blob/lob type. |
|
boolean |
isTextType()
Returns whether or not this column is a text type. |
|
boolean |
isNumericType()
Returns whether or not this column is a numeric type. |
|
boolean |
isBooleanType()
Returns whether or not this column is a boolean type. |
|
boolean |
isTemporalType()
Returns whether or not this column is a temporal type. |
|
boolean |
isPhpArrayType()
Returns whether or not the column is an array column. |
|
boolean |
isEnumType()
Returns whether or not this column is an ENUM column. |
|
setValueSet(array|string $valueSet)
Sets the list of possible values for an ENUM column. |
||
array |
getValueSet()
Returns the list of possible values for an ENUM column. |
|
integer |
getSize()
Returns the column size. |
|
setSize(integer $size)
Sets the column size. |
||
integer |
getScale()
Returns the column scale. |
|
setScale(integer $scale)
Sets the column scale. |
||
getSizeDefinition()
Returns the size and precision in brackets for use in an SQL DLL. |
||
string |
getDefaultValueString()
Returns a string that will give this column a default value in PHP. |
|
Column |
setDefaultValue(ColumnDefaultValue|scalar $def)
Sets a string that will give this column a default value. |
|
ColumnDefaultValue |
getDefaultValue()
Returns the default value object for this column. |
|
mixed |
getPhpDefaultValue()
Returns the default value suitable for use in PHP. |
|
boolean |
isAutoIncrement()
Returns whether or the column is an auto increment/sequence value for the target database. |
|
boolean |
isLazyLoad()
Return whether or not the column has to be lazy loaded. |
|
string |
getAutoIncrementString()
Returns the auto-increment string. |
|
setAutoIncrement(boolean $isAutoIncrement)
Sets whether or not this column is an auto incremented value. |
||
string |
getPhpNative()
Returns a string representation of the native PHP type which corresponds to the Propel type of this column. |
|
boolean |
isPhpPrimitiveType()
Returns whether or not the column PHP native type is primitive type (aka a boolean, an integer, a long, a float, a double or a string). |
|
boolean |
isPhpPrimitiveNumericType()
Returns whether or not the column PHP native type is a primitive numeric type (aka an integer, a long, a float or a double). |
|
boolean |
isPhpObjectType()
Returns whether or not the column PHP native type is an object. |
|
PlatformInterface |
getPlatform()
Returns an instance of PlatformInterface interface. |
|
boolean |
hasPlatform()
Returns whether or not this column has a platform adapter. |
|
__clone()
Clones the current object. |
||
static string |
generatePhpName(string $name, string $phpNamingMethod = PhpNameGenerator::CONV_METHOD_CLEAN, string $namePrefix = null)
Returns a generated PHP name. |
Details
at line 93
public
__construct(string $name = null)
Creates a new column and set the name.
in MappingModel at line 38
public
loadMapping(array $attributes)
Loads a mapping definition from an array.
in MappingModel at line 58
public array
getAttributes()
Returns all definition attributes.
All attribute names (keys) are lowercase.
in MappingModel at line 73
public mixed
getAttribute(string $name, mixed $default = null)
Returns a particular attribute by a case-insensitive name.
If the attribute is not set, then the second default value is
returned instead.
at line 1094
public
appendXml(DOMNode $node)
Appends DOM elements to represent this object in XML.
in MappingModel at line 138
public VendorInfo
addVendorInfo(VendorInfo|array $vendor)
Adds a new VendorInfo instance to this current model object.
in MappingModel at line 158
public VendorInfo
getVendorInfoForType(string $type)
Returns a VendorInfo object by its type.
in MappingModel at line 176
public string
getConfiguredBehavior(string $behavior)
Returns the best class name for a given behavior.
If not found, the method tries to autoload \Propel\Generator\Behavior\[Bname]\[Bname]Behavior
in MappingModel at line 198
public string
toString()
String representation of the current object.
in MappingModel at line 213
public string
__toString()
String representation of the current object.
at line 274
public Domain
getDomain()
Gets domain for this column, creating a new empty domain object if none is set.
at line 288
public
setDomain(Domain $domain)
Sets the domain for this column.
at line 298
public string
getFullyQualifiedName()
Returns the fully qualified column name (table.column).
at line 308
public string
getName()
Returns the column name.
at line 318
public
setName(string $name)
Sets the column name.
at line 328
public boolean
isNamePlural()
Returns whether or not the column name is plural.
at line 338
public string
getSingularName()
Returns the column singular name.
at line 348
public string
getDescription()
Returns the column description.
at line 358
public
setDescription(string $description)
Sets the column description.
at line 369
public string
getPhpName()
Returns the name to use in PHP sources.
It will set & return
a self-generated phpName from it's name if it's not already set.
at line 386
public
setPhpName(string $phpName = null)
Sets the name to use in PHP sources.
It will generate a phpName from it's name if no
$phpName is passed.
at line 402
public string
getStudlyPhpName()
Returns the studly version of the PHP name.
The studly name is the PHP name with the first character lowercase.
at line 412
public string
getAccessorVisibility()
Returns the accessor methods visibility of this column / attribute.
at line 426
public
setAccessorVisibility(string $visibility)
Sets the accessor methods visibility for this column / attribute.
at line 441
public string
getMutatorVisibility()
Returns the mutator methods visibility for this current column.
at line 455
public
setMutatorVisibility(string $visibility)
Sets the mutator methods visibility for this column / attribute.
at line 470
public string
getConstantName()
Returns the full column constant name (e.g.
TableMapName::COLUMN_NAME).
at line 483
public string
getConstantColumnName()
Returns the column constant name.
at line 498
public string
getTableMapName()
Returns the TableMap constant name that will identify this column.
at line 508
public
setTableMapName(string $name)
Sets the TableMap constant name that will identify this column.
at line 520
public string
getPhpType()
Returns the type to use in PHP sources.
If no types has been specified, then use result of getPhpNative().
at line 530
public integer
getPosition()
Returns the location of this column within the table (one-based).
at line 540
public
setPosition(integer $position)
Returns the location of this column within the table (one-based).
at line 550
public
setTable(Table $table)
Sets the parent table.
at line 560
public Table
getTable()
Returns the parent table.
at line 570
public string
getTableName()
Returns the parent table name.
at line 582
public Inheritance
addInheritance(Inheritance|array $inheritance)
Adds a new inheritance definition to the inheritance list and sets the parent column of the inheritance to the current column.
at line 606
public array
getChildren()
Returns the inheritance definitions.
at line 617
public boolean
isInheritance()
Returns whether or not this column is a normal property or specifies a the classes that are represented in the table containing this column.
at line 628
public boolean
isEnumeratedClasses()
Returns whether or not possible classes have been enumerated in the schema file.
at line 638
public boolean
isNotNull()
Returns whether or not the column is not null.
at line 648
public
setNotNull(boolean $notNull)
Sets whether or not the column is not null.
at line 658
public string.
getNotNullString()
Returns NOT NULL string for this column.
at line 671
public
setPrimaryString(boolean $isPrimaryString)
Sets whether or not the column is used as the primary string.
The primary string is the value used by default in the magic
__toString method of an active record object.
at line 682
public boolean
isPrimaryString()
Returns true if the column is the primary string (used for the magic __toString() method).
at line 692
public
setPrimaryKey(boolean $primary)
Sets whether or not the column is a primary key.
at line 702
public boolean
isPrimaryKey()
Returns whether or not the column is the primary key.
at line 712
public
setNodeKey(boolean $isNodeKey)
Sets whether or not the column is a node key of a tree.
at line 722
public boolean
isNodeKey()
Returns whether or not the column is a node key of a tree.
at line 732
public
setNodeKeySep(string $sep)
Sets the separator for the node key column in a tree.
at line 742
public string
getNodeKeySep()
Returns the node key column separator for a tree.
at line 752
public
setNestedSetLeftKey(boolean $isNestedSetLeftKey)
Sets whether or not the column is the nested set left key of a tree.
at line 762
public boolean
isNestedSetLeftKey()
Returns whether or not the column is a nested set key of a tree.
at line 772
public
setNestedSetRightKey(boolean $isNestedSetRightKey)
Set if the column is the nested set right key of a tree.
at line 782
public boolean
isNestedSetRightKey()
Return whether or not the column is a nested set right key of a tree.
at line 792
public
setTreeScopeKey(boolean $isTreeScopeKey)
Sets whether or not the column is the scope key of a tree.
at line 802
public boolean
isTreeScopeKey()
Returns whether or not the column is a scope key of a tree.
at line 812
public
setUnique(boolean $isUnique)
Sets whether or not the column must have a unique index on it.
at line 822
public boolean
isUnique()
Returns whether or not the column must have a unique index.
at line 832
public boolean
requiresTransactionInPostgres()
Returns true if the column requires a transaction in PostGreSQL.
at line 842
public boolean
isForeignKey()
Returns whether or not this column is a foreign key.
at line 852
public boolean
hasMultipleFK()
Returns whether or not this column is part of more than one foreign key.
at line 864
public array
getForeignKeys()
Returns the foreign key objects for this column.
Only if it is a foreign key or part of a foreign key.
at line 874
public
addReferrer(ForeignKey $fk)
Adds the foreign key from another table that refers to this column.
at line 888
public array
getReferrers()
Returns the list of references to this column.
at line 902
public boolean
hasReferrers()
Returns whether or not this column has referers.
at line 914
public boolean
hasReferrer(ForeignKey $fk)
Returns whether or not this column has a specific referrer for a specific foreign key object.
at line 923
public
clearReferrers()
Clears all referrers.
at line 932
public
clearInheritanceList()
Clears all inheritance children.
at line 945
public
setDomainForType(string $mappingType)
Sets the domain up for specified mapping type.
Calling this method will implicitly overwrite any previously set type,
size, scale (or other domain attributes).
at line 956
public
setType(string $mappingType)
Sets the mapping column type.
at line 971
public string
getType()
Returns the Propel column type as a string.
at line 981
public integer
getPDOType()
Returns the column PDO type integer for this column's mapping type.
at line 986
public
isDefaultSqlType(PlatformInterface $platform = null)
at line 1004
public boolean
isLobType()
Returns whether or not this column is a blob/lob type.
at line 1014
public boolean
isTextType()
Returns whether or not this column is a text type.
at line 1024
public boolean
isNumericType()
Returns whether or not this column is a numeric type.
at line 1034
public boolean
isBooleanType()
Returns whether or not this column is a boolean type.
at line 1044
public boolean
isTemporalType()
Returns whether or not this column is a temporal type.
at line 1054
public boolean
isPhpArrayType()
Returns whether or not the column is an array column.
at line 1064
public boolean
isEnumType()
Returns whether or not this column is an ENUM column.
at line 1074
public
setValueSet(array|string $valueSet)
Sets the list of possible values for an ENUM column.
at line 1089
public array
getValueSet()
Returns the list of possible values for an ENUM column.
at line 1172
public integer
getSize()
Returns the column size.
at line 1182
public
setSize(integer $size)
Sets the column size.
at line 1192
public integer
getScale()
Returns the column scale.
at line 1202
public
setScale(integer $scale)
Sets the column scale.
at line 1214
public
getSizeDefinition()
Returns the size and precision in brackets for use in an SQL DLL.
Example: (size[,scale]) <-> (10) or (10,2)
return string
at line 1224
public string
getDefaultValueString()
Returns a string that will give this column a default value in PHP.
at line 1253
public Column
setDefaultValue(ColumnDefaultValue|scalar $def)
Sets a string that will give this column a default value.
at line 1270
public ColumnDefaultValue
getDefaultValue()
Returns the default value object for this column.
at line 1281
public mixed
getPhpDefaultValue()
Returns the default value suitable for use in PHP.
at line 1293
public boolean
isAutoIncrement()
Returns whether or the column is an auto increment/sequence value for the target database.
We need to pass in the properties for the target
database!
at line 1306
public boolean
isLazyLoad()
Return whether or not the column has to be lazy loaded.
For example, if a runtime query on the table doesn't hydrate this column
but a getter does.
at line 1316
public string
getAutoIncrementString()
Returns the auto-increment string.
at line 1340
public
setAutoIncrement(boolean $isAutoIncrement)
Sets whether or not this column is an auto incremented value.
Use isAutoIncrement() to find out if it is set or not.
at line 1352
public string
getPhpNative()
Returns a string representation of the native PHP type which corresponds to the Propel type of this column.
Used in the generation of Base
objects.
at line 1364
public boolean
isPhpPrimitiveType()
Returns whether or not the column PHP native type is primitive type (aka a boolean, an integer, a long, a float, a double or a string).
at line 1376
public boolean
isPhpPrimitiveNumericType()
Returns whether or not the column PHP native type is a primitive numeric type (aka an integer, a long, a float or a double).
at line 1387
public boolean
isPhpObjectType()
Returns whether or not the column PHP native type is an object.
at line 1397
public PlatformInterface
getPlatform()
Returns an instance of PlatformInterface interface.
at line 1407
public boolean
hasPlatform()
Returns whether or not this column has a platform adapter.
at line 1420
public
__clone()
Clones the current object.
at line 1433
static public string
generatePhpName(string $name, string $phpNamingMethod = PhpNameGenerator::CONV_METHOD_CLEAN, string $namePrefix = null)
Returns a generated PHP name.