为了不在每个表中重复设置, 可以在database.yml中进行全局设定.
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=localhost;dbname=xxx'
username: root
password:
attributes:
default_table_charset: utf8
default_table_collate: utf8_general_ci
或者在“/config/ProjectConfiguration.class.php”中设定.
public function configureDoctrine(Doctrine_Manager $manager)
{
$manager->setCollate('utf8_unicode_ci');
$manager->setCharset('utf8');
}