Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 13299e9

Browse files
committed
adjust to phpcr-odm event refactoring and improve docblocks
1 parent 679aeb0 commit 13299e9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

EventListener/AutoRouteListener.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\EventListener;
44

5-
use Doctrine\ODM\PHPCR\Event\OnFlushEventArgs;
5+
use Doctrine\Common\Persistence\Event\ManagerEventArgs;
6+
use Doctrine\ODM\PHPCR\DocumentManager;
67
use Symfony\Component\DependencyInjection\ContainerInterface;
78
use Symfony\Cmf\Bundle\RoutingAutoBundle\Document\AutoRoute;
9+
use Symfony\Cmf\Bundle\RoutingAutoBundle\AutoRoute\AutoRouteManager;
810

911
/**
1012
* Doctrine PHPCR ODM listener for maintaining automatic routes.
@@ -18,16 +20,20 @@ public function __construct(ContainerInterface $container)
1820
$this->container = $container;
1921
}
2022

23+
/**
24+
* @return AutoRouteManager
25+
*/
2126
protected function getArm()
2227
{
2328
// lazy load the auto_route_manager service to prevent a cirular-reference
2429
// to the document manager.
2530
return $this->container->get('cmf_routing_auto.auto_route_manager');
2631
}
2732

28-
public function onFlush(OnFlushEventArgs $args)
33+
public function onFlush(ManagerEventArgs $args)
2934
{
30-
$dm = $args->getDocumentManager();
35+
/** @var $dm DocumentManager */
36+
$dm = $args->getObjectManager();
3137
$uow = $dm->getUnitOfWork();
3238

3339
$scheduledInserts = $uow->getScheduledInserts();

0 commit comments

Comments
 (0)