Skip to content

ColumnSchema ​

Type
Class
Namespace
craft\db\mysql
Inherits
craft\db\mysql\ColumnSchema » yii\db\mysql\ColumnSchema » yii\db\ColumnSchema » yii\base\BaseObject
Implements
yii\base\Configurable

View source

Public Properties ​

PropertyDescription
allowNullboolean – Whether this column can be null.
autoIncrementboolean – Whether this column is auto-incremental
collationstring, null – Collation
commentstring – Comment of this column.
dbTypestring – The DB type of this column.
defaultValuemixed – Default value of this column
disableJsonSupportboolean – Whether the column schema should OMIT using JSON support feature.
enumValuesarray – Enumerable values.
isPrimaryKeyboolean – Whether this column is a primary key
namestring – Name of this column (without quotes).
phpTypestring – The PHP type of this column.
precisioninteger – Precision of the column data, if it is numeric.
scaleinteger – Scale of the column data, if it is numeric.
sizeinteger – Display size of the column.
typestring – Abstract type of this column.
unsignedboolean – Whether this column is unsigned.

collation ​

Type
string, null
Default value
null
Since
5.0.0

Collation

View source

Public Methods ​

MethodDescription
__call()Calls the named method which is not a class method.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
dbTypecast()Converts the input value according to type and dbType for use in a db query.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()Returns a value indicating whether a property is defined.
init()Initializes the object.
phpTypecast()Converts the input value according to phpType after retrieval from the database.

Protected Methods ​

MethodDescription
typecast()Converts the input value according to phpType after retrieval from the database.

typecast() ​

Converts the input value according to phpType after retrieval from the database.

If the value is null or an \Expression, it will not be converted.

View source

Arguments ​

  • $value (mixed) – Input value

Returns ​

mixed – Converted value