Skip to content

Instantly share code, notes, and snippets.

@studentIvan
Created January 30, 2012 01:54
Show Gist options
  • Save studentIvan/1701919 to your computer and use it in GitHub Desktop.
Save studentIvan/1701919 to your computer and use it in GitHub Desktop.
Simple unicode in Doctrine 2 Schema createTable
<?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