| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace Doctrine\DBAL\Platforms;
|
|
|
4 |
|
|
|
5 |
use Doctrine\DBAL\Types\Types;
|
|
|
6 |
use Doctrine\Deprecations\Deprecation;
|
|
|
7 |
|
|
|
8 |
/**
|
|
|
9 |
* Provides the behavior, features and SQL dialect of the MariaDB database platform of the oldest supported version.
|
|
|
10 |
*/
|
|
|
11 |
class MariaDBPlatform extends MySQLPlatform
|
|
|
12 |
{
|
|
|
13 |
/**
|
|
|
14 |
* {@inheritDoc}
|
|
|
15 |
*
|
|
|
16 |
* Hop over the {@see AbstractMySQLPlatform} implementation until 4.0.x
|
|
|
17 |
* where {@see MariaDBPlatform} no longer extends {@see MySQLPlatform}.
|
|
|
18 |
*
|
|
|
19 |
* @internal The method should be only used from within the {@see AbstractPlatform} class hierarchy.
|
|
|
20 |
*/
|
|
|
21 |
public function getDefaultValueDeclarationSQL($column)
|
|
|
22 |
{
|
|
|
23 |
return AbstractPlatform::getDefaultValueDeclarationSQL($column);
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
/**
|
|
|
27 |
* {@inheritdoc}
|
|
|
28 |
*
|
|
|
29 |
* @link https://mariadb.com/kb/en/library/json-data-type/
|
|
|
30 |
*/
|
|
|
31 |
public function getJsonTypeDeclarationSQL(array $column): string
|
|
|
32 |
{
|
|
|
33 |
return 'LONGTEXT';
|
|
|
34 |
}
|
|
|
35 |
|
|
|
36 |
/** @deprecated Implement {@see createReservedKeywordsList()} instead. */
|
|
|
37 |
protected function getReservedKeywordsClass(): string
|
|
|
38 |
{
|
|
|
39 |
Deprecation::triggerIfCalledFromOutside(
|
|
|
40 |
'doctrine/dbal',
|
|
|
41 |
'https://github.com/doctrine/dbal/issues/4510',
|
|
|
42 |
'MariaDb1027Platform::getReservedKeywordsClass() is deprecated,'
|
|
|
43 |
. ' use MariaDb1027Platform::createReservedKeywordsList() instead.',
|
|
|
44 |
);
|
|
|
45 |
|
|
|
46 |
return Keywords\MariaDb102Keywords::class;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
protected function initializeDoctrineTypeMappings(): void
|
|
|
50 |
{
|
|
|
51 |
parent::initializeDoctrineTypeMappings();
|
|
|
52 |
|
|
|
53 |
$this->doctrineTypeMapping['json'] = Types::JSON;
|
|
|
54 |
}
|
|
|
55 |
}
|