$this->isConnected = true;
+ $this->onConnect();
+
$this->notifyDBListeners('postConnect', $event);
return true;
}
-
+
+ protected function onConnect()
+ {
+ }
+
public function incrementQueryCount()
{
$this->_count++;
return $this->exec($query, array_values($fields));
}
- public function setCharset($charset)
- {
- }
-
public function quoteIdentifier($str, $checkOption = true)
{
// quick fix for the identifiers that contain a dot
parent::__construct($manager, $adapter);
}
- public function connect()
+ protected function onConnect()
{
- $connected = parent::connect();
$this->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
- return $connected;
+ $this->exec('SET NAMES \'utf8\'');
}
-
+
public function getDatabaseName()
{
return $this->fetchOne('SELECT DATABASE()');
}
- public function setCharset($charset)
- {
- $query = 'SET NAMES ' . $this->quote($charset);
- $this->exec($query);
- }
-
public function replace(IPF_ORM_Table $table, array $fields, array $keys)
{
if (empty($keys)) {
}
return $query;
}
-}
\ No newline at end of file
+}
if ($persistent)
$conn->setOption(IPF_ORM::ATTR_PERSISTENT, true);
$conn->setName($name);
- $conn->setCharset('utf8');
$this->_connections[$name] = $conn;