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).
Methods
__construct(string $name = null)
Creates a new Index instance. |
from Index | |
boolean |
isUnique()
Returns whether or not this index is unique. |
|
setName(string $name)
Sets the index name. |
from Index | |
string |
getName()
Returns the index name. |
from Index |
setTable(Table $table)
Sets the index parent Table. |
from Index | |
Table |
getTable()
Returns the index parent table. |
from Index |
string |
getTableName()
Returns the name of the index parent table. |
from Index |
addColumn(mixed $data)
Adds a new column to the index. |
from Index | |
setColumns(array $columns)
Sets an array of columns to use for the index. |
from Index | |
boolean |
hasColumnSize(string $name)
Returns whether or not there is a size for the specified column. |
from Index |
integer |
getColumnSize(string $name)
Returns the size for the specified column. |
from Index |
resetColumnsSize()
Resets the columns sizes. |
from Index | |
boolean |
hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)
Returns whether or not this index has a given column at a given position. |
from Index |
boolean |
hasColumns()
Returns whether or not the index has columns. |
from Index |
array |
getColumns()
Returns the list of local columns. |
from Index |
appendXml(DOMNode $node)
Appends DOM elements to represent this object in XML. |
Details
in Index at line 34
public
__construct(string $name = null)
Creates a new Index instance.
at line 32
public boolean
isUnique()
Returns whether or not this index is unique.
Returns Boolean
in Index at line 61
public
setName(string $name)
Sets the index name.
in Index at line 71
public string
getName()
Returns the index name.
in Index at line 105
public
setTable(Table $table)
Sets the index parent Table.
in Index at line 115
public Table
getTable()
Returns the index parent table.
in Index at line 125
public string
getTableName()
Returns the name of the index parent table.
in Index at line 135
public
addColumn(mixed $data)
Adds a new column to the index.
in Index at line 158
public
setColumns(array $columns)
Sets an array of columns to use for the index.
in Index at line 173
public boolean
hasColumnSize(string $name)
Returns whether or not there is a size for the specified column.
in Index at line 184
public integer
getColumnSize(string $name)
Returns the size for the specified column.
in Index at line 194
public
resetColumnsSize()
Resets the columns sizes.
This method is useful for generated indices for FKs.
in Index at line 208
public boolean
hasColumnAtPosition(integer $pos, string $name, integer $size = null, boolean $caseInsensitive = false)
Returns whether or not this index has a given column at a given position.
in Index at line 237
public boolean
hasColumns()
Returns whether or not the index has columns.
in Index at line 249
public array
getColumns()
Returns the list of local columns.
You should not edit this list.
at line 53
public
appendXml(DOMNode $node)
Appends DOM elements to represent this object in XML.