class Unique extends Index
Information about unique columns of a table.
This class assumes
that in the underlying RDBMS, unique constraints and unique indices
are roughly equivalent. For example, adding a unique constraint to
a column also creates an index on that column (this is known to be
true for MySQL and Oracle).
Constants
DEBUG |
enables debug output |
Methods
__construct(string $name = null)
Creates a new Index instance. |
from Index | |
getIsUnique() | from Index | |
isUnique()
Returns <code>true</code>. |
||
getIndexName() | from Index | |
getName()
Gets the name of this index. |
from Index | |
setIndexName($name) | from Index | |
setName($name)
Set the name of this index. |
from Index | |
setTable(Table $parent)
Set the parent Table of the index |
from Index | |
getTable()
Get the parent Table of the index |
from Index | |
getTableName()
Returns the Name of the table the index is in |
from Index | |
addColumn(mixed $data)
Adds a new column to an index. |
from Index | |
setColumns(array $indexColumns)
Sets array of columns to use for index. |
from Index | |
boolean |
hasColumnSize(string $name)
Whether there is a size for the specified column. |
from Index |
numeric |
getColumnSize(string $name)
Returns the size for the specified column, if given. |
from Index |
resetColumnSize()
Reset the column sizes. |
from Index | |
getIndexColumnList() | from Index | |
getColumnList()
Return a comma delimited string of the columns which compose this index. |
from Index | |
getIndexColumns() | from Index | |
boolean |
hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)
Check whether this index has a given column at a given position |
from Index |
boolean |
hasColumns()
Check whether the index has columns. |
from Index |
array |
getColumns()
Return the list of local columns. |
from Index |
appendXml(DOMNode $node) |
Details
in Index at line 42
public
__construct(string $name = null)
Creates a new Index instance.
in Index at line 82
public
getIsUnique()
at line 32
public
isUnique()
Returns <code>true</code>.
in Index at line 99
public
getIndexName()
in Index at line 107
public
getName()
Gets the name of this index.
in Index at line 128
public
setIndexName($name)
in Index at line 136
public
setName($name)
Set the name of this index.
in Index at line 144
public
setTable(Table $parent)
Set the parent Table of the index
in Index at line 152
public
getTable()
Get the parent Table of the index
in Index at line 160
public
getTableName()
Returns the Name of the table the index is in
in Index at line 169
public
addColumn(mixed $data)
Adds a new column to an index.
in Index at line 192
public
setColumns(array $indexColumns)
Sets array of columns to use for index.
in Index at line 206
public boolean
hasColumnSize(string $name)
Whether there is a size for the specified column.
in Index at line 216
public numeric
getColumnSize(string $name)
Returns the size for the specified column, if given.
in Index at line 227
public
resetColumnSize()
Reset the column sizes.
Useful for generated indices for FKs
in Index at line 236
public
getIndexColumnList()
in Index at line 245
public
getColumnList()
Return a comma delimited string of the columns which compose this index.
in Index at line 254
public
getIndexColumns()
in Index at line 270
public boolean
hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)
Check whether this index has a given column at a given position
in Index at line 291
public boolean
hasColumns()
Check whether the index has columns.
in Index at line 300
public array
getColumns()
Return the list of local columns.
You should not edit this list.