1
0
mirror of synced 2025-01-19 06:51:40 +03:00

implements setCharset for mysql, no exception if setCharset is not implemented (fixes #244)

This commit is contained in:
chtito 2006-12-06 06:58:24 +00:00
parent a65e106ecc
commit 7a35e676a9
2 changed files with 12 additions and 4 deletions

View File

@ -450,13 +450,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
* Set the charset on the current connection
*
* @param string charset
* @param resource connection handle
*
* @throws Doctrine_Connection_Exception if the feature is not supported by the driver
* @return true on success, MDB2 Error Object on failure
* @return void
*/
public function setCharset($charset) {
throw new Doctrine_Connection_Exception('Altering charset not supported by this driver.');
}
/**
* fetchAll

View File

@ -88,6 +88,17 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
parent::__construct($manager, $adapter);
}
/**
* Set the charset on the current connection
*
* @param string charset
*
* @return void
*/
public function setCharset($charset) {
$query = 'SET NAMES '.$this->dbh->quote($charset);
$this->dbh->query($query);
}
/**
* Returns the next free id of a sequence
*