1<?php 2 3namespace Doctrine\DBAL\Platforms; 4 5use Doctrine\DBAL\Types\Types; 6 7/** 8 * Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform. 9 * 10 * Note: Should not be used with versions prior to 10.2.7. 11 */ 12final class MariaDb1027Platform extends MySqlPlatform 13{ 14 /** 15 * {@inheritdoc} 16 * 17 * @link https://mariadb.com/kb/en/library/json-data-type/ 18 */ 19 public function getJsonTypeDeclarationSQL(array $field) : string 20 { 21 return 'LONGTEXT'; 22 } 23 24 /** 25 * {@inheritdoc} 26 */ 27 protected function getReservedKeywordsClass() : string 28 { 29 return Keywords\MariaDb102Keywords::class; 30 } 31 32 /** 33 * {@inheritdoc} 34 */ 35 protected function initializeDoctrineTypeMappings() : void 36 { 37 parent::initializeDoctrineTypeMappings(); 38 39 $this->doctrineTypeMapping['json'] = Types::JSON; 40 } 41} 42