TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics Class Reference
Inheritance diagram for TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics:
TYPO3\CMS\Dbal\Database\Specifics\NullSpecifics TYPO3\CMS\Dbal\Database\Specifics\Oci8Specifics TYPO3\CMS\Dbal\Database\Specifics\PostgresSpecifics

Public Member Functions

 __construct ()
 
 specificExists ($specific)
 
 getSpecific ($specific)
 
 splitMaxExpressions ($expressionList, $preserveArrayKeys=false)
 
 truncateIdentifier ($identifier, $specific)
 
 transformQueryParts (&$select_fields, &$from_table, &$where_clause, &$groupBy='', &$orderBy='', &$limit='')
 
 transformFieldRowToMySQL ($fieldRow, $metaType)
 
 getNativeFieldType ($metaType)
 
 getMetaFieldType ($nativeType)
 
 getNativeFieldLength ($mysqlType, $maxLength)
 

Public Attributes

const TABLE_MAXLENGTH = 'table_maxlength'
 
const FIELD_MAXLENGTH = 'field_maxlength'
 
const LIST_MAXEXPRESSIONS = 'list_maxexpressions'
 
const PARTIAL_STRING_INDEX = 'partial_string_index'
 
const CAST_FIND_IN_SET = 'cast_find_in_set'
 

Protected Member Functions

 getNativeNotNull ($notNull)
 
 getNativeDefaultValue ($fieldDefinition)
 
 getNativeKeyForField ($fieldRow)
 
 getNativeExtraFieldAttributes ($fieldRow)
 

Protected Attributes

 $specificProperties = []
 
 $nativeToMetaFieldTypeMap
 
 $nativeToMetaFieldTypeOverrides = []
 
 $metaToNativeFieldTypeMap
 
 $metaToNativeFieldTypeOverrides = []
 

Detailed Description

This class handles the specifics of the active DBMS. Inheriting classes are intended to define their own specifics.

Definition at line 21 of file AbstractSpecifics.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::__construct ( )

Constructor

Definition at line 114 of file AbstractSpecifics.php.

Member Function Documentation

◆ getMetaFieldType()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getMetaFieldType (   $nativeType)

Return MetaType for native MySQL field type

Parameters
string$nativeTypenative type as reported as in mysqldump files
Returns
string Meta type (currently ADOdb syntax only, http://phplens.com/lens/adodb/docs-adodb.htm#metatype)

Definition at line 237 of file AbstractSpecifics.php.

◆ getNativeDefaultValue()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeDefaultValue (   $fieldDefinition)
protected

Return the default value of a field formatted to match the native MySQL SQL dialect

Parameters
array$fieldDefinition
Returns
mixed

Definition at line 280 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getNativeExtraFieldAttributes()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeExtraFieldAttributes (   $fieldRow)
protected

Return the MySQL native extra field information - https://dev.mysql.com/doc/refman/5.5/en/show-columns.html auto_increment for columns that have the AUTO_INCREMENT attribute on update CURRENT_TIMESTAMP for TIMESTAMP columns that have the ON UPDATE CURRENT_TIMESTAMP attribute.

Parameters
array$fieldRow
Returns
string

Definition at line 309 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getNativeFieldLength()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeFieldLength (   $mysqlType,
  $maxLength 
)

Determine the native field length information for a table field.

Parameters
string$mysqlType
int$maxLength
Returns
string

Definition at line 250 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getNativeFieldType()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeFieldType (   $metaType)

Return actual MySQL type for meta field type

Parameters
string$metaTypeMeta type (currenly ADOdb syntax only, http://phplens.com/lens/adodb/docs-adodb.htm#metatype)
Returns
string Native type as reported as in mysqldump files, uppercase

Definition at line 225 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getNativeKeyForField()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeKeyForField (   $fieldRow)
protected

Return the MySQL native key type indicator - https://dev.mysql.com/doc/refman/5.5/en/show-columns.html PRI - the column is a PRIMARY KEY or is one of the columns in a multiple-column PRIMARY KEY UNI - the column is the first column of a UNIQUE index MUL - the column is the first column of a nonunique index If more than one of the values applies return the one with the highest priority, in the order PRI, UNI, MUL If none applies return empty value.

Parameters
array$fieldRow
Returns
string

Definition at line 296 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getNativeNotNull()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getNativeNotNull (   $notNull)
protected

Return the MySQL native representation of the NOT NULL setting

Parameters
mixed$notNull
Returns
string

Definition at line 269 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\transformFieldRowToMySQL().

◆ getSpecific()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::getSpecific (   $specific)

Gets the specific value.

Parameters
string$specific
Returns
mixed

Definition at line 137 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\splitMaxExpressions(), and TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\truncateIdentifier().

◆ specificExists()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::specificExists (   $specific)

Checks if a specific is defined for the used DBMS.

Parameters
string$specific
Returns
bool

Definition at line 126 of file AbstractSpecifics.php.

Referenced by TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\splitMaxExpressions(), and TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\truncateIdentifier().

◆ splitMaxExpressions()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::splitMaxExpressions (   $expressionList,
  $preserveArrayKeys = false 
)

Splits $expressionList into multiple chunks.

Parameters
array$expressionList
bool$preserveArrayKeysIf TRUE, array keys are preserved in array_chunk()
Returns
array

Definition at line 149 of file AbstractSpecifics.php.

References TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\getSpecific(), and TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\specificExists().

◆ transformFieldRowToMySQL()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::transformFieldRowToMySQL (   $fieldRow,
  $metaType 
)

◆ transformQueryParts()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::transformQueryParts ( $select_fields,
$from_table,
$where_clause,
$groupBy = '',
$orderBy = '',
$limit = '' 
)

Adjust query parts for DBMS

Parameters
string$select_fields
string$from_table
string$where_clause
string$groupBy
string$orderBy
string$limit
Returns
void

Definition at line 192 of file AbstractSpecifics.php.

◆ truncateIdentifier()

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::truncateIdentifier (   $identifier,
  $specific 
)

Truncates the name of the identifier. Based on TYPO3.FLOWs' FlowAnnotationDriver::truncateIdentifier()

Parameters
string$identifier
string$specific
Returns
string

Definition at line 166 of file AbstractSpecifics.php.

References TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\getSpecific(), and TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics\specificExists().

Member Data Documentation

◆ $metaToNativeFieldTypeMap

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::$metaToNativeFieldTypeMap
protected
Initial value:
= [
'C' => 'VARCHAR'

Definition at line 85 of file AbstractSpecifics.php.

◆ $metaToNativeFieldTypeOverrides

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::$metaToNativeFieldTypeOverrides = []
protected

Definition at line 109 of file AbstractSpecifics.php.

◆ $nativeToMetaFieldTypeMap

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::$nativeToMetaFieldTypeMap
protected
Initial value:
= [
'STRING' => 'C'

Definition at line 45 of file AbstractSpecifics.php.

◆ $nativeToMetaFieldTypeOverrides

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::$nativeToMetaFieldTypeOverrides = []
protected

Contains the DBMS specific mapping overrides for native MySQL to ADOdb meta field types

Definition at line 78 of file AbstractSpecifics.php.

◆ $specificProperties

TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::$specificProperties = []
protected

Definition at line 38 of file AbstractSpecifics.php.

◆ CAST_FIND_IN_SET

const TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::CAST_FIND_IN_SET = 'cast_find_in_set'

Definition at line 30 of file AbstractSpecifics.php.

◆ FIELD_MAXLENGTH

const TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::FIELD_MAXLENGTH = 'field_maxlength'

Definition at line 27 of file AbstractSpecifics.php.

◆ LIST_MAXEXPRESSIONS

const TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::LIST_MAXEXPRESSIONS = 'list_maxexpressions'

Definition at line 28 of file AbstractSpecifics.php.

◆ PARTIAL_STRING_INDEX

const TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::PARTIAL_STRING_INDEX = 'partial_string_index'

◆ TABLE_MAXLENGTH

const TYPO3\CMS\Dbal\Database\Specifics\AbstractSpecifics::TABLE_MAXLENGTH = 'table_maxlength'

Constants used as identifiers in $specificProperties.

Definition at line 26 of file AbstractSpecifics.php.