Bitrix API

Index extends BaseObject

Class BaseObject Base class for all schema objects such as tables, columns, indexes, etc.

Table of Contents

Properties

$body  : mixed
$columns  : mixed
$fulltext  : mixed
$name  : mixed
$parent  : BaseObject|null
$unique  : mixed
$using  : mixed

Methods

__construct()  : mixed
addColumn()  : Index
Adds column to the index definition.
compareName()  : int
Compares name of the table with given.
create()  : Index
Creates index object from tokens.
getCompareName()  : string
Returns "normalized" name of the table.
getCreateDdl()  : array<string|int, mixed>|string
Return DDL for index creation.
getDropDdl()  : array<string|int, mixed>|string
Return DDL for index destruction.
getLowercasedName()  : string
Returns "lowercased" name of the object.
getModifyDdl()  : array<string|int, mixed>|string
Return DDL for index modification.
getUnquotedName()  : array<string|int, mixed>|string
Returns "unquoted" name of the object.
searchTableName()  : void
Searches token collection for 'ON' keyword.
setBody()  : BaseObject
Sets source code for object.
setParent()  : BaseObject
Sets parent for object.

Properties

$columns

public mixed $columns = []

$fulltext

public mixed $fulltext = false

$unique

public mixed $unique = false

$using

public mixed $using = ''

Methods

__construct()

public __construct([string $name = '' ], bool $unique[, bool $fulltext = false ]) : mixed
Parameters
$name : string = ''

Index name.

$unique : bool

Uniqueness flag.

$fulltext : bool = false

Fulltext flag.

addColumn()

Adds column to the index definition.

public addColumn(string $name) : Index
Parameters
$name : string

Column name.

Return values
Index

compareName()

Compares name of the table with given.

public final compareName(string $name) : int

If name has no quotes when comparison is case insensitive.

Parameters
$name : string

Table name to compare.

Tags
see
strcmp
Return values
int

create()

Creates index object from tokens.

public static create(Tokenizer $tokenizer[, bool $unique = false ][, bool $fulltext = false ][, string $indexName = '' ]) : Index

If parameter $indexName is not passed then current position should point to the name of the index.

Parameters
$tokenizer : Tokenizer

Tokens collection.

$unique : bool = false

Uniqueness flag.

$fulltext : bool = false

Fulltext flag.

$indexName : string = ''

Optional name of the index.

Tags
throws
NotSupportedException
Return values
Index

getCompareName()

Returns "normalized" name of the table.

public final static getCompareName(string $name) : string

If name is not quoted then it made uppercase.

Parameters
$name : string

Table name.

Return values
string

getCreateDdl()

Return DDL for index creation.

public getCreateDdl([string $dbType = '' ]) : array<string|int, mixed>|string
Parameters
$dbType : string = ''

Database type (MYSQL, ORACLE or MSSQL).

Return values
array<string|int, mixed>|string

getDropDdl()

Return DDL for index destruction.

public getDropDdl([string $dbType = '' ]) : array<string|int, mixed>|string
Parameters
$dbType : string = ''

Database type (MYSQL, ORACLE or MSSQL).

Return values
array<string|int, mixed>|string

getLowercasedName()

Returns "lowercased" name of the object.

public final getLowercasedName() : string

If name is not quoted then it made lowercase.

Return values
string

getModifyDdl()

Return DDL for index modification.

public getModifyDdl(BaseObject $target[, string $dbType = '' ]) : array<string|int, mixed>|string
Parameters
$target : BaseObject

Target object.

$dbType : string = ''

Database type (MYSQL, ORACLE or MSSQL).

Return values
array<string|int, mixed>|string

getUnquotedName()

Returns "unquoted" name of the object.

public final getUnquotedName([array<string|int, mixed>|string $name = null ]) : array<string|int, mixed>|string
Parameters
$name : array<string|int, mixed>|string = null

Name or array of names to unquote.

Return values
array<string|int, mixed>|string

searchTableName()

Searches token collection for 'ON' keyword.

public static searchTableName(Tokenizer $tokenizer) : void

Advances current position on to next token skipping whitespace.

Parameters
$tokenizer : Tokenizer

Tokens collection.

Tags
throws
NotSupportedException

        
On this page

Search results