Last active
December 16, 2015 15:08
-
-
Save sergiors/b4f26a7bc92f8c42ae8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Inbep\Component\Doctrine\DBAL\Platforms\Keywords; | |
use Doctrine\DBAL\Platforms\Keywords\PostgreSQL92Keywords; | |
/** | |
* @author Sérgio Rafael Siqueira <[email protected]> | |
*/ | |
class PostgreSQL92ContribKeywords extends PostgreSQL92Keywords | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getName() | |
{ | |
return 'PostgreSQL92Contrib'; | |
} | |
/** | |
* {@inheritdoc} | |
* | |
* @link http://www.postgresql.org/docs/9.2/static/citext.html | |
*/ | |
protected function getKeywords() | |
{ | |
return array_merge(parent::getKeywords(), [ | |
'CITEXT' | |
]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Inbep\Component\Doctrine\DBAL\Platforms; | |
use Doctrine\DBAL\Platforms\PostgreSQL92Platform; | |
/** | |
* @author Sérgio Rafael Siqueira <[email protected]> | |
*/ | |
class PostgreSQL92ContribPlatform extends PostgreSQL92Platform | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getCitextTypeDeclarationSQL(array $field) | |
{ | |
return 'CITEXT'; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function getReservedKeywordsClass() | |
{ | |
return '\Inbep\Component\Doctrine\DBAL\Platforms\Keywords\PostgreSQL92ContribKeywords'; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function initializeDoctrineTypeMappings() | |
{ | |
parent::initializeDoctrineTypeMappings(); | |
$this->doctrineTypeMapping['citext'] = 'text'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment