interface DBIndexable (View source)

Classes that implement the DBIndexable interface will provide options to set various index types and index contents, which will be processed by {@link \SilverStripe\ORM\DataObjectSchema}

Constants

TYPE_INDEX

Index types that can be used. Please check your database driver to ensure choices are supported.

TYPE_UNIQUE

TYPE_FULLTEXT

TYPE_DEFAULT

If "true" is provided to setIndexType, this default index type will be returned

Methods

$this
setIndexType($type)

Set the desired index type to use

string|bool
getIndexType()

Return the desired index type to use. Will return false if the field instance should not be indexed.

array
getIndexSpecs()

Returns the index specifications for the field instance, for example:

Details

$this setIndexType($type)

Set the desired index type to use

Parameters

$type

Return Value

$this

Exceptions

InvalidArgumentException

If $type is not one of TYPE_INDEX, TYPE_UNIQUE or TYPE_FULLTEXT

string|bool getIndexType()

Return the desired index type to use. Will return false if the field instance should not be indexed.

Return Value

string|bool

array getIndexSpecs()

Returns the index specifications for the field instance, for example:

[ 'type' => 'unique', 'columns' => ['FieldName'] ]

Return Value

array