MigrationColumnType
extends BaseModel
in package
Represents a database column type used in migrations.
Important: some Doctrine types map to multiple migration types, for example - Doctrine boolean could be boolean and tinyInteger in migrations. To eliminate the the necessity of guessing, the following migration column types are removed from the list:
- tinyInteger
- mediumInteger
- char
- mediumText
- longText
- float
Tags
Table of Contents
- REGEX_LENGTH_DOUBLE = '/^([0-9]+)\,([0-9]+)$/'
- REGEX_LENGTH_SINGLE = '/^([0-9]+)$/'
- TYPE_BIGINTEGER = 'bigInteger'
- TYPE_BINARY = 'binary'
- TYPE_BOOLEAN = 'boolean'
- TYPE_DATE = 'date'
- TYPE_DATETIME = 'dateTime'
- TYPE_DECIMAL = 'decimal'
- TYPE_DOUBLE = 'double'
- TYPE_INTEGER = 'integer'
- TYPE_SMALLINTEGER = 'smallInteger'
- TYPE_STRING = 'string'
- TYPE_TEXT = 'text'
- TYPE_TIME = 'time'
- TYPE_TIMESTAMP = 'timestamp'
- $exists : bool
- $fillable : mixed
- $pluginCodeObj : PluginCode
- $updatedData : mixed
- $validationMessages : mixed
- $validationRules : mixed
- doctrineLengthToMigrationLength() : string
- Converts Doctrine length, precision and scale to migration-compatible length string
- fill() : mixed
- getDecimalTypes() : mixed
- getDoctrineTypeMap() : mixed
- getIntegerTypes() : mixed
- getModelPluginName() : mixed
- getPluginCodeObj() : mixed
- isNewModel() : mixed
- lengthToPrecisionAndScale() : mixed
- Returns an array containing a column length, precision and scale, basing on the column type.
- setPluginCode() : mixed
- Sets a string code of a plugin the model is associated with
- setPluginCodeObj() : mixed
- Sets a code object of a plugin the model is associated with
- toDoctrineTypeName() : mixed
- Converts a migration column type to a corresponding Doctrine mapping type name.
- toMigrationMethodName() : mixed
- Converts Doctrine mapping type name to a migration column method name
- validate() : mixed
- validateLength() : mixed
- Validates the column length parameter basing on the column type
- validateBeforeCreate() : mixed
Constants
REGEX_LENGTH_DOUBLE
public
mixed
REGEX_LENGTH_DOUBLE
= '/^([0-9]+)\,([0-9]+)$/'
REGEX_LENGTH_SINGLE
public
mixed
REGEX_LENGTH_SINGLE
= '/^([0-9]+)$/'
TYPE_BIGINTEGER
public
mixed
TYPE_BIGINTEGER
= 'bigInteger'
TYPE_BINARY
public
mixed
TYPE_BINARY
= 'binary'
TYPE_BOOLEAN
public
mixed
TYPE_BOOLEAN
= 'boolean'
TYPE_DATE
public
mixed
TYPE_DATE
= 'date'
TYPE_DATETIME
public
mixed
TYPE_DATETIME
= 'dateTime'
TYPE_DECIMAL
public
mixed
TYPE_DECIMAL
= 'decimal'
TYPE_DOUBLE
public
mixed
TYPE_DOUBLE
= 'double'
TYPE_INTEGER
public
mixed
TYPE_INTEGER
= 'integer'
TYPE_SMALLINTEGER
public
mixed
TYPE_SMALLINTEGER
= 'smallInteger'
TYPE_STRING
public
mixed
TYPE_STRING
= 'string'
TYPE_TEXT
public
mixed
TYPE_TEXT
= 'text'
TYPE_TIME
public
mixed
TYPE_TIME
= 'time'
TYPE_TIMESTAMP
public
mixed
TYPE_TIMESTAMP
= 'timestamp'
Properties
$exists
public
bool
$exists
= false
This property is used by the system internally.
$fillable
protected
static mixed
$fillable
= []
$pluginCodeObj
protected
PluginCode
$pluginCodeObj
= null
The plugin code object the model is associated with.
$updatedData
protected
mixed
$updatedData
= []
$validationMessages
protected
mixed
$validationMessages
= []
$validationRules
protected
mixed
$validationRules
= []
Methods
doctrineLengthToMigrationLength()
Converts Doctrine length, precision and scale to migration-compatible length string
public
static doctrineLengthToMigrationLength(mixed $column) : string
Parameters
- $column : mixed
Return values
string —fill()
public
fill(array<string|int, mixed> $attributes) : mixed
Parameters
- $attributes : array<string|int, mixed>
Return values
mixed —getDecimalTypes()
public
static getDecimalTypes() : mixed
Return values
mixed —getDoctrineTypeMap()
public
static getDoctrineTypeMap() : mixed
Return values
mixed —getIntegerTypes()
public
static getIntegerTypes() : mixed
Return values
mixed —getModelPluginName()
public
getModelPluginName() : mixed
Return values
mixed —getPluginCodeObj()
public
getPluginCodeObj() : mixed
Return values
mixed —isNewModel()
public
isNewModel() : mixed
Return values
mixed —lengthToPrecisionAndScale()
Returns an array containing a column length, precision and scale, basing on the column type.
public
static lengthToPrecisionAndScale(mixed $type, mixed $length) : mixed
Parameters
- $type : mixed
- $length : mixed
Return values
mixed —setPluginCode()
Sets a string code of a plugin the model is associated with
public
setPluginCode(string $code) : mixed
Parameters
- $code : string
-
Specifies the plugin code
Return values
mixed —setPluginCodeObj()
Sets a code object of a plugin the model is associated with
public
setPluginCodeObj(PluginCode $obj) : mixed
Parameters
- $obj : PluginCode
-
Specifies the plugin code object
Return values
mixed —toDoctrineTypeName()
Converts a migration column type to a corresponding Doctrine mapping type name.
public
static toDoctrineTypeName(mixed $type) : mixed
Parameters
- $type : mixed
Return values
mixed —toMigrationMethodName()
Converts Doctrine mapping type name to a migration column method name
public
static toMigrationMethodName(mixed $type, mixed $columnName) : mixed
Parameters
- $type : mixed
- $columnName : mixed
Return values
mixed —validate()
public
validate() : mixed
Return values
mixed —validateLength()
Validates the column length parameter basing on the column type
public
static validateLength(mixed $type, mixed $value) : mixed
Parameters
- $type : mixed
- $value : mixed
Return values
mixed —validateBeforeCreate()
protected
validateBeforeCreate() : mixed