Skip to content

Commit

Permalink
check if dbal is doctrine2 dbal
Browse files Browse the repository at this point in the history
  • Loading branch information
Karsten Gohm committed Jun 21, 2011
1 parent 3122117 commit 5a04b87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Nutwerk/Extension/DoctrineORMExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 21,11 @@
class DoctrineORMExtension implements ExtensionInterface
{
public function register(Application $app)
{
if (!$app['db'] instanceof Silex\Extension\DoctrineExtension) {
throw new \InvalidArgumentException('$app[\'db\'] must be an instance of Silex\Extension\DoctrineExtension')
{
$dbal = $app['db'];

if (!$dbal instanceof \Doctrine\DBAL\Connection) {
throw new \InvalidArgumentException('$app[\'db\'] must be an instance of \Doctrine\DBAL\Connection');
}

$this->loadDoctrineConfiguration($app);
Expand Down

0 comments on commit 5a04b87

Please sign in to comment.