This is an old revision of the document!
addIndexObject
From Version 5.21.0-beta-2
See Also
Syntax
obj addIndexObject( string $indexName, optional string $platform=''
)
The method addIndexObject()
is part of the Structured Schema Management suite, and adds an index to the current table object. The index object is a container for Index Item objects, which are the columns themselves.
Parameters
$indexName
The attribute can be provided as a string, a numeric or associative array, and can describe any parameter understood by the DBMS. For example, it might be necessary to add an option to tell the DBMS what type of database engine to use.
Platform
The platform parameter can be any parameter recognized by the Platform keyword.
Usage
In the following example, a table employees is to be created. The table has 2 columns, COL1 and COL2 and an index COL1-IDX will be created, holding COL1.
$t = new metaObjectStructure($dict,'employees'); $t->addColumnObject('COL1','I'); $t->addColumnObject('COL2','C(60)'); $i = $t->addIndexObject('COL1-IDX'); $i->addIndexItemObject('COL1-IDX','COL1')