====== addColumnObject ======
~~NOTOC~~
**From Version 5.21.0-beta-2**
== See Also ==
[[v5:dictionary:structure:introduction|Structured Schema Management]]\\
[[v5:dictionary:column_attributes|Column Attributes Reference]]\\
== Syntax ==
obj addColumnObject(
string $columnName,
string $columnType,
optional string $platform=''
)
The method ''addColumnObject()'' is part of the **//Structured Schema Management//** suite, and adds a column to the current [[v5:dictionary:stucture:metaobjectstructure|table]] object.
---------------------------------------------
===== Parameters =====
==== $columnName ====
The column name can be any value understood by the DBMS.
==== $columnType ====
The column type is declared using a [[v5:dictionary:metatype|metaType]] definition.
==== Platform ====
The platform parameter can be any parameter recognized by the [[v5:dictionary:structure:platform|Platform]] keyword.
===== Usage =====
In the following example, a table **//employees//** is to be created. The table has 2 columns, COL1 and COL2
$t = new metaObjectStructure($dict,'employees');
$t->addColumnObject('COL1','I');
$t->addColumnObject('COL2','C(60)');