Bitrix API

Column extends BaseObject

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

Table of Contents

Properties

$body  : mixed
$default  : mixed
$enum  : mixed
$length  : mixed
$name  : mixed
$nullable  : mixed
$parent  : Table|null
$precision  : mixed
$type  : mixed
$typeAddition  : mixed
$unsigned  : mixed

Methods

__construct()  : mixed
checkType()  : bool
Checks the $type against type list: - INT - INTEGER - TINYINT - NUMERIC - NUMBER - FLOAT - DOUBLE - DECIMAL - BIGINT - SMALLINT - MEDIUMINT - VARCHAR - CHAR - TIMESTAMP - DATETIME - DATE - TIME - TEXT - LONGTEXT - MEDIUMTEXT - TINYTEXT - BLOB - MEDIUMBLOB - LONGBLOB - TINYBLOB - BINARY - VARBINARY - ENUM - SET - BOOLEAN
compareName()  : int
Compares name of the table with given.
create()  : Column
Creates column object from tokens.
getCompareName()  : string
Returns "normalized" name of the table.
getCreateDdl()  : array<string|int, mixed>|string
Return DDL for table column creation.
getDdlType()  : string
Returns DDL presentation of column data type.
getDropDdl()  : array<string|int, mixed>|string
Return DDL for column destruction.
getLength()  : int
Returns storage size for the column.
getLowercasedName()  : string
Returns "lowercased" name of the object.
getModifyDdl()  : array<string|int, mixed>|string
Return DDL for object modification.
getUnquotedName()  : array<string|int, mixed>|string
Returns "unquoted" name of the object.
setBody()  : BaseObject
Sets source code for object.
setParent()  : BaseObject
Sets parent for object.

Properties

$default

public mixed $default = null

$length

public mixed $length = ''

$nullable

public mixed $nullable = true

$precision

public mixed $precision = 0

$typeAddition

public mixed $typeAddition = ''

$unsigned

public mixed $unsigned = false

Methods

__construct()

public __construct([string $name = '' ]) : mixed
Parameters
$name : string = ''

Name of the table.

checkType()

Checks the $type against type list: - INT - INTEGER - TINYINT - NUMERIC - NUMBER - FLOAT - DOUBLE - DECIMAL - BIGINT - SMALLINT - MEDIUMINT - VARCHAR - CHAR - TIMESTAMP - DATETIME - DATE - TIME - TEXT - LONGTEXT - MEDIUMTEXT - TINYTEXT - BLOB - MEDIUMBLOB - LONGBLOB - TINYBLOB - BINARY - VARBINARY - ENUM - SET - BOOLEAN

public static checkType(string $type) : bool
Parameters
$type : string

Type of a column.

Return values
bool

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 column object from tokens.

public static create(Tokenizer $tokenizer[, mixed $parent = null ]) : Column

Current position should point to the name of the column.

Parameters
$tokenizer : Tokenizer

Tokens collection.

$parent : mixed = null
Tags
throws
NotSupportedException
Return values
Column

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 table column 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

getDdlType()

Returns DDL presentation of column data type.

public getDdlType() : string
Return values
string

getDropDdl()

Return DDL for column 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

getLength()

Returns storage size for the column.

public getLength(int $charWidth[, int $maxLength = null ]) : int
Parameters
$charWidth : int

Collation defined maximum character size in bytes.

$maxLength : int = null

Overwrite column definition length.

Tags
throws
NotSupportedException
Return values
int

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 object modification.

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

Implemented only for MySQL database. For Oracle or MS SQL returns commentary.

Parameters
$target : BaseObject

Column 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

        
On this page

Search results