class Index extends AbstractAsset implements Constraint (View source)

Properties

protected string $_name from AbstractAsset
protected $_quoted from AbstractAsset
protected array $_columns
protected bool $_isUnique
protected bool $_isPrimary

Methods

_setName(string $name)

Set name of this asset

bool
isQuoted(string $identifier)

Check if this identifier is quoted.

string
trimQuotes(string $identifier)

Trim quotes from the identifier.

string
getName()

Return name of this schema asset.

string
getQuotedName(AbstractPlatform $platform)

Get the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.

string
_generateIdentifierName(array $columnNames, string $prefix = '', int $maxSize = 30)

Generate an identifier from a list of column names obeying a certain string length.

__construct($indexName, array $columns, $isUnique = false, $isPrimary = false)

No description

_addColumn(string $column)

No description

getColumns()

No description

bool
isSimpleIndex()

Is the index neither unique nor primary key?

bool
isUnique()

No description

bool
isPrimary()

No description

bool
hasColumnAtPosition(string $columnName, int $pos = 0)

No description

boolean
spansColumns(array $columnNames)

Check if this index exactly spans the given column names in the correct order.

bool
isFullfilledBy(Index $other)

Check if the other index already fullfills all the indexing and constraint needs of the current one.

bool
overrules(Index $other)

Detect if the other index is a non-unique, non primary index that can be overwritten by this one.

Details

protected _setName(string $name)

Set name of this asset

Parameters

string $name

protected bool isQuoted(string $identifier)

Check if this identifier is quoted.

Parameters

string $identifier

Return Value

bool

protected string trimQuotes(string $identifier)

Trim quotes from the identifier.

Parameters

string $identifier

Return Value

string

string getName()

Return name of this schema asset.

Return Value

string

string getQuotedName(AbstractPlatform $platform)

Get the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.

Parameters

AbstractPlatform $platform

Return Value

string

protected string _generateIdentifierName(array $columnNames, string $prefix = '', int $maxSize = 30)

Generate an identifier from a list of column names obeying a certain string length.

This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, however building idents automatically for foreign keys, composite keys or such can easily create very long names.

Parameters

array $columnNames
string $prefix
int $maxSize

Return Value

string

__construct($indexName, array $columns, $isUnique = false, $isPrimary = false)

Parameters

$indexName
array $columns
$isUnique
$isPrimary

protected _addColumn(string $column)

Parameters

string $column

getColumns()

bool isSimpleIndex()

Is the index neither unique nor primary key?

Return Value

bool

bool isUnique()

Return Value

bool

bool isPrimary()

Return Value

bool

bool hasColumnAtPosition(string $columnName, int $pos = 0)

Parameters

string $columnName
int $pos

Return Value

bool

boolean spansColumns(array $columnNames)

Check if this index exactly spans the given column names in the correct order.

Parameters

array $columnNames

Return Value

boolean

bool isFullfilledBy(Index $other)

Check if the other index already fullfills all the indexing and constraint needs of the current one.

Parameters

Index $other

Return Value

bool

bool overrules(Index $other)

Detect if the other index is a non-unique, non primary index that can be overwritten by this one.

Parameters

Index $other

Return Value

bool