final class IndexDefinition (View source)

Provides the index definition contract for the database subsystem.

Methods

__construct(IndexType $type, array $columns, string|null $name = null, bool $ifNotExists = false)
primary(string|array $columns, string|null $name = null, bool $ifNotExists = false)
index(string|array $columns, string|null $name = null, bool $ifNotExists = false)
unique(string|array $columns, string|null $name = null, bool $ifNotExists = false)
fulltext(string|array $columns, string|null $name = null, bool $ifNotExists = false)
spatial(string|array $columns, string|null $name = null, bool $ifNotExists = false)
IndexType
type()

Provides this part of the database contract while preserving the object's current state and driver semantics.

IndexType
array
array
string|null
name()

Provides this part of the database contract while preserving the object's current state and driver semantics.

string|null
bool

Provides this part of the database contract while preserving the object's current state and driver semantics.

bool
withIfNotExists(bool $ifNotExists = true)

Updates the query or object state used by subsequent database operations.

string

Resolves the effective value from the configured database dependencies and input.

string

Details

__construct

__construct(IndexType $type, array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

IndexType $type
array $columns
string|null $name
bool $ifNotExists

primary

static IndexDefinition primary(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

IndexDefinition

index

static IndexDefinition index(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

IndexDefinition

unique

static IndexDefinition unique(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

IndexDefinition

fulltext

static IndexDefinition fulltext(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

IndexDefinition

spatial

static IndexDefinition spatial(string|array $columns, string|null $name = null, bool $ifNotExists = false)

No description

Parameters

string|array $columns
string|null $name
bool $ifNotExists

Return Value

IndexDefinition

type

IndexType type()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

IndexType

columns

array columns()

No description

Return Value

array

name

string|null name()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string|null

ifNotExists

bool ifNotExists()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

bool

withIfNotExists

IndexDefinition withIfNotExists(bool $ifNotExists = true)

Updates the query or object state used by subsequent database operations.

Parameters

bool $ifNotExists

Return Value

IndexDefinition

resolvedName

string resolvedName()

Resolves the effective value from the configured database dependencies and input.

Return Value

string