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 |
||
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 46
public
__construct(string $name = null)
Creates a new Index instance.
in Index at line 86
public
getIsUnique()
at line 32
public
isUnique()
Returns true
.
in Index at line 103
public
getIndexName()
in Index at line 111
public
getName()
Gets the name of this index.
in Index at line 132
public
setIndexName($name)
in Index at line 140
public
setName($name)
Set the name of this index.
in Index at line 148
public
setTable(Table $parent)
Set the parent Table of the index
in Index at line 156
public
getTable()
Get the parent Table of the index
in Index at line 164
public
getTableName()
Returns the Name of the table the index is in
in Index at line 174
public
addColumn(mixed $data)
Adds a new column to an index.
in Index at line 197
public
setColumns(array $indexColumns)
Sets array of columns to use for index.
in Index at line 213
public boolean
hasColumnSize(string $name)
Whether there is a size for the specified column.
in Index at line 225
public numeric
getColumnSize(string $name)
Returns the size for the specified column, if given.
in Index at line 237
public
resetColumnSize()
Reset the column sizes.
Useful for generated indices for FKs
in Index at line 246
public
getIndexColumnList()
in Index at line 256
public
getColumnList()
Return a comma delimited string of the columns which compose this index.
in Index at line 265
public
getIndexColumns()
in Index at line 281
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 304
public boolean
hasColumns()
Check whether the index has columns.
in Index at line 314
public array
getColumns()
Return the list of local columns.
You should not edit this list.
at line 40
public
appendXml(DOMNode $node)