Skip to content

Commit

Permalink
Fixed bug with doctrine logging in doctrine application resource
Browse files Browse the repository at this point in the history
  • Loading branch information
epixa committed Jan 30, 2011
1 parent 0819ae9 commit 9cf9445
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions library/Epixa/Application/Resource/Doctrine.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public function init()
if (isset($options['entityPaths'])) {
$entityPaths = $options['entityPaths'];
}

$logger = null;
if (isset($options['loggerClass'])) {
$logger = new $options['loggerClass'];
}

$config = new Configuration;
$config->setMetadataCacheImpl($cache);
Expand All @@ -73,8 +78,8 @@ public function init()
$config->setProxyNamespace($proxyNamespace);
$config->setAutoGenerateProxyClasses($autoGenerateProxies);

if (isset($options['loggerClass'])) {
$config->setSQLLogger($options['loggerClass']);
if ($logger) {
$config->setSQLLogger($logger);
}

return EntityManager::create($connection, $config);
Expand Down

0 comments on commit 9cf9445

Please sign in to comment.