From ce6e42e9b48ccb3337452ddac6d0adb80f8879f0 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Mon, 5 Oct 2015 17:13:41 +0200 Subject: [PATCH] #PHRAS-741 #time 15m added 2 events --- lib/Alchemy/Phrasea/Command/Command.php | 8 ++++++++ lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php | 4 ++-- lib/classes/collection.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/Command.php b/lib/Alchemy/Phrasea/Command/Command.php index afdd7f9d88..76a5bd6334 100644 --- a/lib/Alchemy/Phrasea/Command/Command.php +++ b/lib/Alchemy/Phrasea/Command/Command.php @@ -52,6 +52,14 @@ abstract class Command extends SymfoCommand implements CommandInterface return $logger; }) ); + + $this->container['dispatcher'] = $this->container->share( + $this->container->extend('dispatcher', function ($dispatcher, Application $app) { + $dispatcher->addSubscriber($app['phraseanet.bo-events-subscriber']); + + return $dispatcher; + }) + ); } return $this->doExecute($input, $output); diff --git a/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php b/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php index f96535b242..2d043e760c 100644 --- a/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php +++ b/lib/Alchemy/Phrasea/Core/Event/CollectionUnmounted.php @@ -11,8 +11,8 @@ class CollectionUnmounted extends CollectionRelated return $this->args['coll_id']; } - public function getName() + public function getCollName() { - return $this->args['name']; + return $this->args['coll_name']; } } diff --git a/lib/classes/collection.php b/lib/classes/collection.php index 2de90959fd..17b8629284 100644 --- a/lib/classes/collection.php +++ b/lib/classes/collection.php @@ -625,7 +625,7 @@ class collection implements cache_cacheableInterface null, // the coll is not available anymore array( 'coll_id'=>$old_coll_id, - 'name'=>$old_name + 'coll_name'=>$old_name ) ) );