Created
January 30, 2012 01:54
-
-
Save studentIvan/1701919 to your computer and use it in GitHub Desktop.
Simple unicode in Doctrine 2 Schema createTable
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 | |
use \Doctrine\DBAL\Schema\Schema; | |
use \Doctrine\DBAL\Schema\Table; | |
class UnicodeSchema extends Schema | |
{ | |
/** | |
* Create schema table with specific encoding | |
* | |
* @param string $tableName | |
* @return \Doctrine\DBAL\Schema\Table | |
*/ | |
public function createTable($tableName) { | |
$table = new Table($tableName, array(), array(), array(), 0, array( | |
'charset' => 'utf8', | |
'collate' => 'utf8_general_ci', | |
)); | |
$this->_addTable($table); | |
return $table; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment