class Index extends AbstractAsset implements Constraint (View source)

Properties

protected string $_name from AbstractAsset
protected string|null $_namespace Namespace of the asset. If none isset the default namespace is assumed. from AbstractAsset
protected boolean $_quoted from AbstractAsset
protected Identifier[] $_columns Asset identifier instances of the column names the index is associated with.
protected boolean $_isUnique
protected boolean $_isPrimary
protected array $_flags Platform specific flags for indexes.

Methods

void
_setName(string $name)

Sets the name of this asset.

boolean
isInDefaultNamespace(string $defaultNamespaceName)

Is this asset in the default namespace?

string|null
getNamespaceName()

Gets the namespace name of this asset.

string
getShortestName(string $defaultNamespaceName)

The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.

string
getFullQualifiedName(string $defaultNamespaceName)

The normalized name is full-qualified and lowerspaced. Lowerspacing is actually wrong, but we have to do it to keep our sanity. If you are using database objects that only differentiate in the casing (FOO vs Foo) then you will NOT be able to use Doctrine Schema abstraction.

boolean
isQuoted()

Checks if this asset's name is quoted.

boolean
isIdentifierQuoted(string $identifier)

Checks if this identifier is quoted.

string
trimQuotes(string $identifier)

Trim quotes from the identifier.

string
getName()

Returns the name of this schema asset.

string
getQuotedName(AbstractPlatform $platform)

Gets 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 = '', integer $maxSize = 30)

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

__construct(string $indexName, array $columns, boolean $isUnique = false, boolean $isPrimary = false, array $flags = array(), array $options = array())

No description

void
_addColumn(string $column)

No description

array
getColumns()

Returns the names of the referencing table columns the constraint is associated with.

array
getQuotedColumns(AbstractPlatform $platform)

Returns the quoted representation of the column names the constraint is associated with.

string[]
getUnquotedColumns()

No description

boolean
isSimpleIndex()

Is the index neither unique nor primary key?

boolean
isUnique()

No description

boolean
isPrimary()

No description

boolean
hasColumnAtPosition(string $columnName, integer $pos = 0)

No description

boolean
spansColumns(array $columnNames)

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

boolean
isFullfilledBy(Index $other)

Checks if the other index already fulfills all the indexing and constraint needs of the current one.

boolean
overrules(Index $other)

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

string[]
getFlags()

Returns platform specific flags for indexes.

addFlag(string $flag)

Adds Flag for an index that translates to platform specific handling.

boolean
hasFlag(string $flag)

Does this index have a specific flag?

void
removeFlag(string $flag)

Removes a flag.

boolean
hasOption(string $name)

No description

mixed
getOption(string $name)

No description

array
getOptions()

No description

Details

protected void _setName(string $name)

Sets the name of this asset.

Parameters

string $name

Return Value

void

boolean isInDefaultNamespace(string $defaultNamespaceName)

Is this asset in the default namespace?

Parameters

string $defaultNamespaceName

Return Value

boolean

string|null getNamespaceName()

Gets the namespace name of this asset.

If NULL is returned this means the default namespace is used.

Return Value

string|null

string getShortestName(string $defaultNamespaceName)

The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.

Parameters

string $defaultNamespaceName

Return Value

string

string getFullQualifiedName(string $defaultNamespaceName)

The normalized name is full-qualified and lowerspaced. Lowerspacing is actually wrong, but we have to do it to keep our sanity. If you are using database objects that only differentiate in the casing (FOO vs Foo) then you will NOT be able to use Doctrine Schema abstraction.

Every non-namespaced element is prefixed with the default namespace name which is passed as argument to this method.

Parameters

string $defaultNamespaceName

Return Value

string

boolean isQuoted()

Checks if this asset's name is quoted.

Return Value

boolean

protected boolean isIdentifierQuoted(string $identifier)

Checks if this identifier is quoted.

Parameters

string $identifier

Return Value

boolean

protected string trimQuotes(string $identifier)

Trim quotes from the identifier.

Parameters

string $identifier

Return Value

string

string getName()

Returns the name of this schema asset.

Return Value

string

string getQuotedName(AbstractPlatform $platform)

Gets 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 = '', integer $maxSize = 30)

Generates 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
integer $maxSize

Return Value

string

__construct(string $indexName, array $columns, boolean $isUnique = false, boolean $isPrimary = false, array $flags = array(), array $options = array())

Parameters

string $indexName
array $columns
boolean $isUnique
boolean $isPrimary
array $flags
array $options

protected void _addColumn(string $column)

Parameters

string $column

Return Value

void

Exceptions

InvalidArgumentException

array getColumns()

Returns the names of the referencing table columns the constraint is associated with.

Return Value

array

array getQuotedColumns(AbstractPlatform $platform)

Returns the quoted representation of the column names the constraint is associated with.

But only if they were defined with one or a column name is a keyword reserved by the platform. Otherwise the plain unquoted value as inserted is returned.

Parameters

AbstractPlatform $platform The platform to use for quotation.

Return Value

array

string[] getUnquotedColumns()

Return Value

string[]

boolean isSimpleIndex()

Is the index neither unique nor primary key?

Return Value

boolean

boolean isUnique()

Return Value

boolean

boolean isPrimary()

Return Value

boolean

boolean hasColumnAtPosition(string $columnName, integer $pos = 0)

Parameters

string $columnName
integer $pos

Return Value

boolean

boolean spansColumns(array $columnNames)

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

Parameters

array $columnNames

Return Value

boolean

boolean isFullfilledBy(Index $other)

Checks if the other index already fulfills all the indexing and constraint needs of the current one.

Parameters

Index $other

Return Value

boolean

boolean overrules(Index $other)

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

Parameters

Index $other

Return Value

boolean

string[] getFlags()

Returns platform specific flags for indexes.

Return Value

string[]

Index addFlag(string $flag)

Adds Flag for an index that translates to platform specific handling.

Parameters

string $flag

Return Value

Index

boolean hasFlag(string $flag)

Does this index have a specific flag?

Parameters

string $flag

Return Value

boolean

void removeFlag(string $flag)

Removes a flag.

Parameters

string $flag

Return Value

void

boolean hasOption(string $name)

Parameters

string $name

Return Value

boolean

mixed getOption(string $name)

Parameters

string $name

Return Value

mixed

array getOptions()

Return Value

array