Class

Column

class Column extends XMLElement

A Class for holding data about a column used in an Application.

Constants

DEFAULT_TYPE

DEFAULT_VISIBILITY

Properties

static $valid_visibilities

Methods

loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

from XMLElement
array getAttributes()

Returns the assoc array of attributes.

from XMLElement
mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

from XMLElement
appendXml(DOMNode $node)

VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

from XMLElement
VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

from XMLElement
string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

from XMLElement
toString()

String representation of the current object.

from XMLElement
__toString()

Magic string method

from XMLElement
__construct(string $name = null)

Creates a new column and set the name

static string makeList($columns, PropelPlatformInterface $platform)

Return a comma delimited string listing the specified columns.

Domain getDomain()

Gets domain for this column, creating a new empty domain object if none is set.

setDomain(Domain $domain)

Sets domain for this column

getFullyQualifiedName()

Returns table.column

getName()

Get the name of the column

setName($newName)

Set the name of the column

isNamePlural()

Determines whether a column name is plural

getSingularName()

Gets the singular name for the column

getDescription()

Get the description for the Table

setDescription(newDescription $newDescription)

Set the description for the Table

string getPhpName()

Get name to use in PHP sources.

setPhpName(String $phpName = null)

Set name to use in PHP sources.

string getStudlyPhpName()

Get studly version of PHP name.

string getAccessorVisibility()

Get the visibility of the accessors of this column / attribute

setAccessorVisibility($newVisibility $newVisibility)

Set the visibility of the accessor methods for this column / attribute

string getMutatorVisibility()

Get the visibility of the mutator of this column / attribute

setMutatorVisibility($newVisibility $newVisibility)

Set the visibility of the mutator methods for this column / attribute

string getConstantName()

Get the column constant name (e.g.

getConstantColumnName()

string getPeerName()

Get the Peer constant name that will identify this column.

setPeerName($name $name)

Set the Peer constant name that will identify this column.

string getPhpType()

Get type to use in PHP sources.

int getPosition()

Get the location of this column within the table (one-based).

setPosition(int $v)

Get the location of this column within the table (one-based).

setTable(Table $parent)

Set the parent Table of the column

getTable()

Get the parent Table of the column

getTableName()

Returns the Name of the table the column is in

Inheritance addInheritance(Inheritance|string $inhdata)

Adds a new inheritance definition to the inheritance list and set the parent column of the inheritance to the current column

getChildren()

Get the inheritance definitions.

isInheritance()

Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.

isEnumeratedClasses()

Determine if possible classes have been enumerated in the xml file.

isNotNull()

Return the isNotNull property of the column

setNotNull($status)

Set the isNotNull property of the column

"NOT getNotNullString()

Return NOT NULL String for this column

setPrimaryString(boolean $v)

Set whether the column is the primary string, i.e.

isPrimaryString()

Return true if the column is the primary string, i.e.

setPrimaryKey(boolean $v)

Set whether the column is a primary key or not.

isPrimaryKey()

Return true if the column is a primary key

setNodeKey($nk)

Set if the column is the node key of a tree

isNodeKey()

Return true if the column is a node key of a tree

setNodeKeySep($sep)

Set if the column is the node key of a tree

getNodeKeySep()

Return true if the column is a node key of a tree

setNestedSetLeftKey($nslk)

Set if the column is the nested set left key of a tree

isNestedSetLeftKey()

Return true if the column is a nested set key of a tree

setNestedSetRightKey($nsrk)

Set if the column is the nested set right key of a tree

isNestedSetRightKey()

Return true if the column is a nested set right key of a tree

setTreeScopeKey($tsk)

Set if the column is the scope key of a tree

boolean isTreeScopeKey()

Return true if the column is a scope key of a tree

setUnique(boolean $u)

Set true if the column is UNIQUE

boolean isUnique()

Get the UNIQUE property.

boolean requiresTransactionInPostgres()

Return true if the column requires a transaction in Postgres

boolean isForeignKey()

Utility method to determine if this column is a foreign key.

boolean hasMultipleFK()

Whether this column is a part of more than one foreign key.

array getForeignKeys()

Get the foreign key objects for this column (if it is a foreign key or part of a foreign key)

addReferrer(ForeignKey $fk)

Adds the foreign key from another table that refers to this column.

getReferrers()

Get list of references to this column.

hasReferrers()

hasReferrer(ForeignKey $fk)

clearReferrers()

clearInheritanceList()

setDomainForType(string $propelType)

Sets the domain up for specified Propel type.

setType(string $propelType)

Sets the propel colunm type.

string getType()

Returns the Propel column type as a string.

int getPDOType()

Returns the column PDO type integer for this column's Propel type.

getPropelType()

Returns the column type as given in the schema as an object

isDefaultSqlType(PropelPlatformInterface $platform = null)

boolean isLobType()

Utility method to know whether column needs Blob/Lob handling.

isTextType()

Utility method to see if the column is text type.

boolean isNumericType()

Utility method to see if the column is numeric type.

boolean isBooleanType()

Utility method to see if the column is boolean type.

boolean isTemporalType()

Utility method to know whether column is a temporal column.

boolean isPhpArrayType()

Utility method to know whether column is an array column.

boolean isEnumType()

Utility method to know whether column is an ENUM column.

setValueSet(array $valueSet)

Sets the list of possible values for an ENUM column

array getValueSet()

Returns the list of possible values for an ENUM column

string getSize()

Returns the size of the column

setSize(string $newSize)

Set the size of the column

string getScale()

Returns the scale of the column

setScale(string $newScale)

Set the scale of the column

printSize()

Return the size in brackets for use in an sql schema if the type is String.

string getDefaultSetting()

Return a string that will give this column a default value in SQL

string getDefaultValueString()

Return a string that will give this column a default value in PHP

Column setDefaultValue(ColumnDefaultValue|int|float|bool|string $def)

Set a string that will give this column a default value.

ColumnDefaultValue getDefaultValue()

Get the default value object for this column.

mixed getPhpDefaultValue()

Get the default value suitable for use in PHP.

isAutoIncrement()

Return auto increment/sequence string for the target database.

isLazyLoad()

Return true if the columns has to be lazy loaded, i.e.

string getAutoIncrementString()

Gets the auto-increment string.

setAutoIncrement($value)

Set the auto increment value.

setTypeFromString($typeName, $size)

Set the column type from a string property (normally a string from an sql input file)

string getPhpNative()

Return a string representation of the native PHP type which corresponds to the propel type of this column.

boolean isPhpPrimitiveType()

Returns true if the column's PHP native type is an boolean, int, long, float, double, string.

boolean isPhpPrimitiveNumericType()

Return true if column's PHP native type is an boolean, int, long, float, double.

boolean isPhpObjectType()

Returns true if the column's PHP native type is a class name.

PropelPlatformInterface getPlatform()

Get the platform/adapter impl.

hasPlatform()

getValidator()

__clone()

static  generatePhpName($name, $phpNamingMethod = PhpNameGenerator::CONV_METHOD_CLEAN, $namePrefix = null)

Details

in XMLElement at line 48
public loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

It calls a setupObject() method that must be implemented by the child class.

Parameters

array $attributes The attributes for the XML tag.

in XMLElement at line 60
public array getAttributes()

Returns the assoc array of attributes.

All attribute names (keys) are lowercase.

Return Value

array

in XMLElement at line 74
public mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

If attribute is not set then the $defaultValue is returned.

Parameters

string $name The [case-insensitive] name of the attribute to lookup.
mixed $defaultValue The default value to use in case the attribute is not set.

Return Value

mixed The value of the attribute or $defaultValue if not set.

at line 1029
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)

in XMLElement at line 134
public VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

Parameters

mixed $data VendorInfo object or XML attrib data (array)

Return Value

VendorInfo

in XMLElement at line 154
public VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

Parameters

$type

Return Value

VendorInfo

in XMLElement at line 176
public string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

Parameters

string $bname behavior name, e.g. 'timestampable'

Return Value

string behavior class name, e.g. 'TimestampableBehavior'

Exceptions

InvalidArgumentException

in XMLElement at line 199
public toString()

String representation of the current object.

This is an xml representation with the XML declaration removed.

See also

appendXml()

in XMLElement at line 214
public __toString()

Magic string method

See also

toString()

at line 111
public __construct(string $name = null)

Creates a new column and set the name

Parameters

string $name

at line 125
static public string makeList($columns, PropelPlatformInterface $platform)

Return a comma delimited string listing the specified columns.

Parameters

$columns
PropelPlatformInterface $platform

Return Value

string

at line 278
public Domain getDomain()

Gets domain for this column, creating a new empty domain object if none is set.

Return Value

Domain

at line 292
public setDomain(Domain $domain)

Sets domain for this column

Parameters

Domain $domain

at line 300
public getFullyQualifiedName()

Returns table.column

at line 308
public getName()

Get the name of the column

at line 316
public setName($newName)

Set the name of the column

Parameters

$newName

at line 324
public isNamePlural()

Determines whether a column name is plural

at line 332
public getSingularName()

Gets the singular name for the column

at line 340
public getDescription()

Get the description for the Table

at line 350
public setDescription(newDescription $newDescription)

Set the description for the Table

Parameters

newDescription $newDescription description for the Table

at line 362
public string getPhpName()

Get name to use in PHP sources.

It will set & return a self-generated phpName from it's name if it's not already set.

Return Value

string

at line 379
public setPhpName(String $phpName = null)

Set name to use in PHP sources.

It will generate a phpName from it's name if no $phpName is passed.

Parameters

String $phpName PhpName to be set

at line 395
public string getStudlyPhpName()

Get studly version of PHP name.

The studly name is the PHP name with the first character lowercase.

Return Value

string

at line 411
public string getAccessorVisibility()

Get the visibility of the accessors of this column / attribute

Return Value

string

at line 425
public setAccessorVisibility($newVisibility $newVisibility)

Set the visibility of the accessor methods for this column / attribute

Parameters

$newVisibility $newVisibility string

at line 439
public string getMutatorVisibility()

Get the visibility of the mutator of this column / attribute

Return Value

string

at line 453
public setMutatorVisibility($newVisibility $newVisibility)

Set the visibility of the mutator methods for this column / attribute

Parameters

$newVisibility $newVisibility string

at line 467
public string getConstantName()

Get the column constant name (e.g.

PeerName::COLUMN_NAME).

Return Value

string A column constant name for insertion into PHP code

at line 475
public getConstantColumnName()

at line 490
public string getPeerName()

Get the Peer constant name that will identify this column.

Return Value

string

at line 500
public setPeerName($name $name)

Set the Peer constant name that will identify this column.

Parameters

$name $name string

at line 513
public string getPhpType()

Get type to use in PHP sources.

If no type has been specified, then uses results of getPhpNative().

Return Value

string The type name.

See also

getPhpNative()

at line 527
public int getPosition()

Get the location of this column within the table (one-based).

Return Value

int value of position.

at line 537
public setPosition(int $v)

Get the location of this column within the table (one-based).

Parameters

int $v Value to assign to position.

at line 545
public setTable(Table $parent)

Set the parent Table of the column

Parameters

Table $parent

at line 553
public getTable()

Get the parent Table of the column

at line 561
public getTableName()

Returns the Name of the table the column is in

at line 574
public Inheritance addInheritance(Inheritance|string $inhdata)

Adds a new inheritance definition to the inheritance list and set the parent column of the inheritance to the current column

Parameters

Inheritance|string $inhdata Inheritance or XML data.

Return Value

Inheritance

at line 597
public getChildren()

Get the inheritance definitions.

at line 606
public isInheritance()

Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.

at line 614
public isEnumeratedClasses()

Determine if possible classes have been enumerated in the xml file.

at line 622
public isNotNull()

Return the isNotNull property of the column

at line 630
public setNotNull($status)

Set the isNotNull property of the column

Parameters

$status

at line 640
public "NOT getNotNullString()

Return NOT NULL String for this column

Return Value

"NOT NULL" if null values are not allowed or an empty string.

at line 651
public setPrimaryString(boolean $v)

Set whether the column is the primary string, i.e.

whether its value is the default string representation of the table

Parameters

boolean $v

at line 660
public isPrimaryString()

Return true if the column is the primary string, i.e.

if its value is the default string representation of the table

at line 670
public setPrimaryKey(boolean $v)

Set whether the column is a primary key or not.

Parameters

boolean $v

at line 678
public isPrimaryKey()

Return true if the column is a primary key

at line 686
public setNodeKey($nk)

Set if the column is the node key of a tree

Parameters

$nk

at line 694
public isNodeKey()

Return true if the column is a node key of a tree

at line 702
public setNodeKeySep($sep)

Set if the column is the node key of a tree

Parameters

$sep

at line 710
public getNodeKeySep()

Return true if the column is a node key of a tree

at line 718
public setNestedSetLeftKey($nslk)

Set if the column is the nested set left key of a tree

Parameters

$nslk

at line 726
public isNestedSetLeftKey()

Return true if the column is a nested set key of a tree

at line 734
public setNestedSetRightKey($nsrk)

Set if the column is the nested set right key of a tree

Parameters

$nsrk

at line 742
public isNestedSetRightKey()

Return true if the column is a nested set right key of a tree

at line 750
public setTreeScopeKey($tsk)

Set if the column is the scope key of a tree

Parameters

$tsk

at line 760
public boolean isTreeScopeKey()

Return true if the column is a scope key of a tree

Return Value

boolean

at line 770
public setUnique(boolean $u)

Set true if the column is UNIQUE

Parameters

boolean $u

at line 780
public boolean isUnique()

Get the UNIQUE property.

Return Value

boolean

at line 790
public boolean requiresTransactionInPostgres()

Return true if the column requires a transaction in Postgres

Return Value

boolean

at line 800
public boolean isForeignKey()

Utility method to determine if this column is a foreign key.

Return Value

boolean

at line 810
public boolean hasMultipleFK()

Whether this column is a part of more than one foreign key.

Return Value

boolean

at line 820
public array getForeignKeys()

Get the foreign key objects for this column (if it is a foreign key or part of a foreign key)

Return Value

array

at line 828
public addReferrer(ForeignKey $fk)

Adds the foreign key from another table that refers to this column.

Parameters

ForeignKey $fk

at line 839
public getReferrers()

Get list of references to this column.

at line 848
public hasReferrers()

at line 853
public hasReferrer(ForeignKey $fk)

Parameters

ForeignKey $fk

at line 858
public clearReferrers()

at line 863
public clearInheritanceList()

at line 876
public setDomainForType(string $propelType)

Sets the domain up for specified Propel type.

Calling this method will implicitly overwrite any previously set type, size, scale (or other domain attributes).

Parameters

string $propelType

at line 888
public setType(string $propelType)

Sets the propel colunm type.

Parameters

string $propelType

See also

Domain::setType()

at line 902
public string getType()

Returns the Propel column type as a string.

Return Value

string The constant representing Propel type: e.g. "VARCHAR".

See also

Domain::getType()

at line 912
public int getPDOType()

Returns the column PDO type integer for this column's Propel type.

Return Value

int The integer value representing PDO type param: e.g. PDO::PARAM_INT

at line 920
public getPropelType()

Returns the column type as given in the schema as an object

at line 925
public isDefaultSqlType(PropelPlatformInterface $platform = null)

Parameters

PropelPlatformInterface $platform

at line 943
public boolean isLobType()

Utility method to know whether column needs Blob/Lob handling.

Return Value

boolean

at line 951
public isTextType()

Utility method to see if the column is text type.

at line 961
public boolean isNumericType()

Utility method to see if the column is numeric type.

Return Value

boolean

at line 971
public boolean isBooleanType()

Utility method to see if the column is boolean type.

Return Value

boolean

at line 981
public boolean isTemporalType()

Utility method to know whether column is a temporal column.

Return Value

boolean

at line 991
public boolean isPhpArrayType()

Utility method to know whether column is an array column.

Return Value

boolean

at line 1001
public boolean isEnumType()

Utility method to know whether column is an ENUM column.

Return Value

boolean

at line 1011
public setValueSet(array $valueSet)

Sets the list of possible values for an ENUM column

Parameters

array $valueSet

at line 1021
public array getValueSet()

Returns the list of possible values for an ENUM column

Return Value

array

at line 1107
public string getSize()

Returns the size of the column

Return Value

string

at line 1117
public setSize(string $newSize)

Set the size of the column

Parameters

string $newSize

at line 1127
public string getScale()

Returns the scale of the column

Return Value

string

at line 1137
public setScale(string $newScale)

Set the scale of the column

Parameters

string $newScale

at line 1146
public printSize()

Return the size in brackets for use in an sql schema if the type is String.

Otherwise return an empty string

at line 1157
public string getDefaultSetting()

Return a string that will give this column a default value in SQL

Return Value

string

at line 1167
public string getDefaultValueString()

Return a string that will give this column a default value in PHP

Return Value

string

at line 1194
public Column setDefaultValue(ColumnDefaultValue|int|float|bool|string $def)

Set a string that will give this column a default value.

Parameters

ColumnDefaultValue|int|float|bool|string $def column default value

Return Value

Column

at line 1210
public ColumnDefaultValue getDefaultValue()

Get the default value object for this column.

Return Value

ColumnDefaultValue

See also

Domain::getDefaultValue()

at line 1221
public mixed getPhpDefaultValue()

Get the default value suitable for use in PHP.

Return Value

mixed

See also

Domain::getPhpDefaultValue()

at line 1230
public isAutoIncrement()

Return auto increment/sequence string for the target database.

We need to pass in the props for the target database!

at line 1239
public isLazyLoad()

Return true if the columns has to be lazy loaded, i.e.

if a runtime query on the table doesn't hydrate this column, but a getter does.

at line 1250
public string getAutoIncrementString()

Gets the auto-increment string.

Return Value

string

Exceptions

EngineException

at line 1269
public setAutoIncrement($value)

Set the auto increment value.

Use isAutoIncrement() to find out if it is set or not.

Parameters

$value

at line 1280
public setTypeFromString($typeName, $size)

Set the column type from a string property (normally a string from an sql input file)

Parameters

$typeName
$size

at line 1312
public string getPhpNative()

Return a string representation of the native PHP type which corresponds to the propel type of this column.

Use in the generation of Base objects.

Return Value

string PHP datatype used by propel.

at line 1323
public boolean isPhpPrimitiveType()

Returns true if the column's PHP native type is an boolean, int, long, float, double, string.

Return Value

boolean

See also

PropelTypes::isPhpPrimitiveType()

at line 1334
public boolean isPhpPrimitiveNumericType()

Return true if column's PHP native type is an boolean, int, long, float, double.

Return Value

boolean

See also

PropelTypes::isPhpPrimitiveNumericType()

at line 1345
public boolean isPhpObjectType()

Returns true if the column's PHP native type is a class name.

Return Value

boolean

See also

PropelTypes::isPhpObjectType()

at line 1355
public PropelPlatformInterface getPlatform()

Get the platform/adapter impl.

at line 1360
public hasPlatform()

at line 1365
public getValidator()

at line 1374
public __clone()

at line 1379
static public generatePhpName($name, $phpNamingMethod = PhpNameGenerator::CONV_METHOD_CLEAN, $namePrefix = null)

Parameters

$name
$phpNamingMethod
$namePrefix