CustomDoctrineTypesColumnDefinitionTrait

Provide shared custom doctrine types processing to all extended SchemaManager classes:

  • MySQLSchemaManager
  • SQLiteSchemaManager
  • PostgreSQLSchemaManager
Internal

only for use in extended SchemaManager classes and not part of public core API.

Tags
todo

ENUM and SET does not work for SQLite and PostgresSQL. SQLite supports it with a slightly other syntax and PostgreSQL needs to create a custom type with a human-readable name, which is not reasonable either. Consider to deprecate and drop ENUM/SET support due not having compatibility for all supported database systems.

  • @see https://www.postgresql.org/docs/current/datatype-enum.html#DATATYPE-ENUM (PostgreSQL)
  • @see https://www.sqlite.org/lang_createtable.html#ckconst (SQlite)
  • @see https://stackoverflow.com/questions/5299267/how-to-create-enum-type-in-sqlite

Table of Contents

Methods

getDatabaseType()  : string
Extract the field type from the definition string
getUnquotedEnumerationValues()  : array<string|int, mixed>
processCustomDoctrineTypesColumnDefinition()  : Column|null
This method is used to handle additional processing for custom doctrine types.

Methods

getDatabaseType()

Extract the field type from the definition string

protected getDatabaseType(string $typeDefinition) : string
Parameters
$typeDefinition : string
Return values
string

getUnquotedEnumerationValues()

protected getUnquotedEnumerationValues(string $typeDefinition) : array<string|int, mixed>
Parameters
$typeDefinition : string
Return values
array<string|int, mixed>

processCustomDoctrineTypesColumnDefinition()

This method is used to handle additional processing for custom doctrine types.

protected processCustomDoctrineTypesColumnDefinition(array<string|int, mixed> $tableColumn, AbstractPlatform $platform) : Column|null

Note: doctrine/dbal dropped the event listener system, and this replaces the used onSchemaColumnDefinition() event lower than doctrine/dbal 4.x.

Parameters
$tableColumn : array<string|int, mixed>
$platform : AbstractPlatform
Return values
Column|null

        
On this page

Search results