Propel API
Class

Unique

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.

Parameters

string $name

in Index at line 82
public getIsUnique()

See also

#isUnique()

at line 32
public isUnique()

Returns <code>true</code>.

in Index at line 99
public getIndexName()

See also

#getName()

in Index at line 107
public getName()

Gets the name of this index.

in Index at line 128
public setIndexName($name)

Parameters

$name

See also

#setName(String name)

in Index at line 136
public setName($name)

Set the name of this index.

Parameters

$name

in Index at line 144
public setTable(Table $parent)

Set the parent Table of the index

Parameters

Table $parent

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.

Parameters

mixed $data Column or attributes from XML.

in Index at line 192
public setColumns(array $indexColumns)

Sets array of columns to use for index.

Parameters

array $indexColumns Column[]

in Index at line 206
public boolean hasColumnSize(string $name)

Whether there is a size for the specified column.

Parameters

string $name

Return Value

boolean

in Index at line 216
public numeric getColumnSize(string $name)

Returns the size for the specified column, if given.

Parameters

string $name

Return Value

numeric The size or NULL

in Index at line 228
public resetColumnSize()

Reset the column sizes.

Useful for generated indices for FKs

in Index at line 237
public getIndexColumnList()

See also

#getColumnList()

in Index at line 246
public getColumnList()

Return a comma delimited string of the columns which compose this index.

in Index at line 255
public getIndexColumns()

See also

#getColumns()

in Index at line 271
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

Parameters

integer $pos Position in the column list
string $name Column name
integer $size optional size check
boolean $caseInsensitive Whether the comparison is case insensitive. False by default.

Return Value

boolean

in Index at line 293
public boolean hasColumns()

Check whether the index has columns.

Return Value

boolean

in Index at line 302
public array getColumns()

Return the list of local columns.

You should not edit this list.

Return Value

array string[]

at line 40
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)