/** * @param ConnectionInterface $connection Propel connection */ public function __construct(ConnectionInterface $connection, array $logMethods = array('beginTransaction', 'commit', 'rollBack', 'forceRollBack', 'exec', 'query', 'execute')) { if ($connection instanceof ProfilerConnectionWrapper) { $connection->setLogMethods($logMethods); $this->config = $connection->getProfiler()->getConfiguration(); $this->handler = new TestHandler(); if ($connection->getLogger() instanceof Logger) { $this->logger = $connection->getLogger(); $this->logger->pushHandler($this->handler); } else { $this->errors[] = 'Supported only monolog logger'; } } else { $this->errors[] = 'You need set ProfilerConnectionWrapper'; } }