Skip to content

Commit 1e4cf57

Browse files
committed
Fix Doctrine deprecation notice in RegisterListenersService
1 parent cc9c801 commit 1e4cf57

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"require-dev": {
2525
"doctrine/orm": "^2.5",
2626
"doctrine/doctrine-bundle": "^1.6",
27+
"doctrine/persistence": "^1.3.3",
2728
"doctrine/phpcr-bundle": "^1.3|^2.0",
2829
"doctrine/phpcr-odm": "^1.4",
2930
"jackalope/jackalope-doctrine-dbal": "^1.2",

src/Doctrine/RegisterListenersService.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<?php
2+
3+
/*
4+
* This file is part of the FOSElasticaBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
212
namespace FOS\ElasticaBundle\Doctrine;
313

4-
use Doctrine\Common\Persistence\ObjectManager;
514
use Doctrine\ODM\MongoDB\DocumentManager;
615
use Doctrine\ORM\EntityManagerInterface;
16+
use Doctrine\Persistence\ObjectManager;
717
use FOS\ElasticaBundle\Persister\Event\Events;
818
use FOS\ElasticaBundle\Persister\Event\PersistEvent;
919
use FOS\ElasticaBundle\Provider\PagerInterface;
@@ -49,7 +59,7 @@ public function register(ObjectManager $manager, PagerInterface $pager, array $o
4959
if (false == $options['debug_logging'] && $manager instanceof EntityManagerInterface) {
5060
$configuration = $manager->getConnection()->getConfiguration();
5161
$logger = $configuration->getSQLLogger();
52-
62+
5363
$this->addListener($pager, Events::PRE_FETCH_OBJECTS, function() use ($configuration) {
5464
$configuration->setSQLLogger(null);
5565
});

0 commit comments

Comments
 (0)