|
@@ 275-283 (lines=9) @@
|
| 272 |
|
/** |
| 273 |
|
* Disable Doctrine logging |
| 274 |
|
*/ |
| 275 |
|
protected function disableLogging() |
| 276 |
|
{ |
| 277 |
|
//TODO: do we need to add support for MongoDB logging? |
| 278 |
|
if (!($this->objectManager instanceof \Doctrine\ORM\EntityManager)) return; |
| 279 |
|
|
| 280 |
|
$config = $this->objectManager->getConnection()->getConfiguration(); |
| 281 |
|
$this->originalLogger = $config->getSQLLogger(); |
| 282 |
|
$config->setSQLLogger(null); |
| 283 |
|
} |
| 284 |
|
|
| 285 |
|
/** |
| 286 |
|
* Re-enable Doctrine logging |
|
@@ 288-295 (lines=8) @@
|
| 285 |
|
/** |
| 286 |
|
* Re-enable Doctrine logging |
| 287 |
|
*/ |
| 288 |
|
protected function reEnableLogging() |
| 289 |
|
{ |
| 290 |
|
//TODO: do we need to add support for MongoDB logging? |
| 291 |
|
if (!($this->objectManager instanceof \Doctrine\ORM\EntityManager)) return; |
| 292 |
|
|
| 293 |
|
$config = $this->objectManager->getConnection()->getConfiguration(); |
| 294 |
|
$config->setSQLLogger($this->originalLogger); |
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
/** |
| 298 |
|
* Finds existing object or create a new instance |