Injected propel.connection in the PropelDataCollector collector
This commit is contained in:
parent
398c1b9566
commit
284dfeb355
|
@ -31,6 +31,12 @@ class PropelDataCollector extends DataCollector
|
|||
* @var \PropelConfiguration
|
||||
*/
|
||||
protected $propelConfiguration;
|
||||
/**
|
||||
* Propel connection
|
||||
*
|
||||
* @var \PropelPDO
|
||||
*/
|
||||
protected $propelConnection;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -38,11 +44,12 @@ class PropelDataCollector extends DataCollector
|
|||
* @param \Propel\PropelBundle\Logger\PropelLogger $logger A PropelLogger
|
||||
* @param string $connectionName A connection name
|
||||
*/
|
||||
public function __construct(\Propel\PropelBundle\Logger\PropelLogger $logger, $connectionName, \PropelConfiguration $propelConfiguration)
|
||||
public function __construct(\Propel\PropelBundle\Logger\PropelLogger $logger, $connectionName, \PropelConfiguration $propelConfiguration, \PropelPDO $propelConnection)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
$this->connectionName = $connectionName;
|
||||
$this->propelConfiguration = $propelConfiguration;
|
||||
$this->propelConnection = $propelConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,7 +60,7 @@ class PropelDataCollector extends DataCollector
|
|||
{
|
||||
$this->data = array(
|
||||
'queries' => $this->buildQueries(),
|
||||
'querycount' => \Propel::getConnection($this->connectionName)->getQueryCount(),
|
||||
'querycount' => $this->propelConnection->getQueryCount(),
|
||||
'connectionName' => $this->connectionName,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
<argument type="service" id="propel.logger" />
|
||||
<argument>%propel.dbal.default_connection%</argument>
|
||||
<argument type="service" id="propel.configuration" />
|
||||
<argument type="service" id="propel.connection" />
|
||||
</service>
|
||||
</services>
|
||||
</container>
|
||||
|
|
Loading…
Reference in a new issue