ColumnSchema

Type
Class
Namespace
craft\db\mysql
Inherits
craft\db\mysql\ColumnSchema » yii\db\mysql\ColumnSchema (opens new window) » yii\db\ColumnSchema (opens new window) » yii\base\BaseObject (opens new window)
Implements
yii\base\Configurable (opens new window)

View source (opens new window)

# Public Properties

Property Description
allowNull (opens new window) boolean (opens new window) – Whether this column can be null.
autoIncrement (opens new window) boolean (opens new window) – Whether this column is auto-incremental
comment (opens new window) string (opens new window) – Comment of this column.
dbType (opens new window) string (opens new window) – The DB type of this column.
defaultValue (opens new window) mixed – Default value of this column
disableJsonSupport (opens new window) boolean (opens new window) – Whether the column schema should OMIT using JSON support feature.
enumValues (opens new window) array (opens new window) – Enumerable values.
isPrimaryKey (opens new window) boolean (opens new window) – Whether this column is a primary key
name (opens new window) string (opens new window) – Name of this column (without quotes).
phpType (opens new window) string (opens new window) – The PHP type of this column.
precision (opens new window) integer (opens new window) – Precision of the column data, if it is numeric.
scale (opens new window) integer (opens new window) – Scale of the column data, if it is numeric.
size (opens new window) integer (opens new window) – Display size of the column.
type (opens new window) string (opens new window) – Abstract type of this column.
unsigned (opens new window) boolean (opens new window) – Whether this column is unsigned.

# Public Methods

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

# Protected Methods

Method Description
typecast() Converts the input value according to phpType (opens new window) after retrieval from the database.

# typecast()

Converts the input value according to phpType (opens new window) after retrieval from the database.

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

View source (opens new window)

Arguments

  • $value (mixed) – Input value

Returns

mixed – Converted value