Adding the propel connection to the dependency injection container

This commit is contained in:
Maxime AILLOUD 2011-07-13 16:00:09 +02:00 committed by William DURAND
parent f74c659f24
commit 1777dc4a9d
2 changed files with 10 additions and 0 deletions

View file

@ -121,6 +121,12 @@ class PropelExtension extends Extension
}
$container->getDefinition('propel.configuration')->setArguments(array($c));
$container
->getDefinition('propel.connection')
->setArguments(array($name)
)
;
}
/**

View file

@ -6,6 +6,8 @@
<parameters>
<parameter key="propel.dbal.default_connection">default</parameter>
<parameter key="propel.connection.class">PDO</parameter>
<parameter key="propel.connection_factory.class">Propel</parameter>
<parameter key="propel.configuration.class">PropelConfiguration</parameter>
<parameter key="propel.logger.class">Propel\PropelBundle\Logger\PropelLogger</parameter>
<parameter key="propel.data_collector.class">Propel\PropelBundle\DataCollector\PropelDataCollector</parameter>
@ -17,6 +19,8 @@
<services>
<service id="propel.configuration" class="%propel.configuration.class%" />
<service id="propel.connection" class="%propel.connection.class%" factory-class="%propel.connection_factory.class%" factory-method="getConnection" abstract="false" />
<service id="propel.build_properties" class="%propel.build_properties.class%" />
<service id="propel.logger" class="%propel.logger.class%">