PHP Класс yii\db\ColumnSchema

С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$allowNull whether this column can be null.
$autoIncrement whether this column is auto-incremental
$comment comment of this column. Not all DBMS support this.
$dbType the DB type of this column. Possible DB types vary according to the type of DBMS.
$defaultValue default value of this column
$enumValues enumerable values. This is set only if the column is declared to be an enumerable type.
$isPrimaryKey whether this column is a primary key
$name name of this column (without quotes).
$phpType the PHP type of this column. Possible PHP types include: string, boolean, integer, double.
$precision precision of the column data, if it is numeric.
$scale scale of the column data, if it is numeric.
$size display size of the column.
$type abstract type of this column. Possible abstract types include: char, string, text, boolean, smallint, integer, bigint, float, decimal, datetime, timestamp, time, date, binary, and money.
$unsigned whether this column is unsigned. This is only meaningful when [[type]] is smallint, integer or bigint.

Открытые методы

Метод Описание
dbTypecast ( mixed $value ) : mixed Converts the input value according to [[type]] and [[dbType]] for use in a db query.
phpTypecast ( mixed $value ) : mixed Converts the input value according to [[phpType]] after retrieval from the database.

Защищенные методы

Метод Описание
typecast ( mixed $value ) : mixed Converts the input value according to [[phpType]] after retrieval from the database.

Описание методов

dbTypecast() публичный Метод

If the value is null or an [[Expression]], it will not be converted.
public dbTypecast ( mixed $value ) : mixed
$value mixed input value
Результат mixed converted value. This may also be an array containing the value as the first element and the PDO type as the second element.

phpTypecast() публичный Метод

If the value is null or an [[Expression]], it will not be converted.
public phpTypecast ( mixed $value ) : mixed
$value mixed input value
Результат mixed converted value

typecast() защищенный Метод

If the value is null or an [[Expression]], it will not be converted.
С версии: 2.0.3
protected typecast ( mixed $value ) : mixed
$value mixed input value
Результат mixed converted value

Описание свойств

$allowNull публичное свойство

whether this column can be null.
public $allowNull

$autoIncrement публичное свойство

whether this column is auto-incremental
public $autoIncrement

$comment публичное свойство

comment of this column. Not all DBMS support this.
public $comment

$dbType публичное свойство

the DB type of this column. Possible DB types vary according to the type of DBMS.
public $dbType

$defaultValue публичное свойство

default value of this column
public $defaultValue

$enumValues публичное свойство

enumerable values. This is set only if the column is declared to be an enumerable type.
public $enumValues

$isPrimaryKey публичное свойство

whether this column is a primary key
public $isPrimaryKey

$name публичное свойство

name of this column (without quotes).
public $name

$phpType публичное свойство

the PHP type of this column. Possible PHP types include: string, boolean, integer, double.
public $phpType

$precision публичное свойство

precision of the column data, if it is numeric.
public $precision

$scale публичное свойство

scale of the column data, if it is numeric.
public $scale

$size публичное свойство

display size of the column.
public $size

$type публичное свойство

abstract type of this column. Possible abstract types include: char, string, text, boolean, smallint, integer, bigint, float, decimal, datetime, timestamp, time, date, binary, and money.
public $type

$unsigned публичное свойство

whether this column is unsigned. This is only meaningful when [[type]] is smallint, integer or bigint.
public $unsigned