From 3b9c194e5156d68753e6a3ca6e73abeb3dee45d6 Mon Sep 17 00:00:00 2001 From: PaulCombal Date: Fri, 1 Mar 2019 13:12:17 +0100 Subject: [PATCH] auto --- NotificationsBundle/Controller/MainController.php | 5 ++--- NotificationsBundle/Resources/config/services.yaml | 8 ++++---- NotificationsBundle/Service/FooService.php | 20 -------------------- NotificationsBundle/Service/NotificationsService.php | 20 ++++++++++++++++++++ composer.json | 4 ++-- 5 files changed, 28 insertions(+), 29 deletions(-) delete mode 100644 NotificationsBundle/Service/FooService.php create mode 100644 NotificationsBundle/Service/NotificationsService.php diff --git a/NotificationsBundle/Controller/MainController.php b/NotificationsBundle/Controller/MainController.php index 8f85e49..7c0d7e1 100644 --- a/NotificationsBundle/Controller/MainController.php +++ b/NotificationsBundle/Controller/MainController.php @@ -10,9 +10,8 @@ class MainController extends AbstractController { public function index(Request $request) { - die($request->getMethod()); // ON PEUT PAS INJECTER UN SERVICE DU BUNDLE EN QUESTION DANS LES ARGS DONC ON LE récupère ainsi : - $this->get('bluesquare.notifications_bundle.foo')->foo(); - die('hello'); + $r = $this->get('bluesquare.notifications_bundle.notifssrv')->foo(); + die($r); } } \ No newline at end of file diff --git a/NotificationsBundle/Resources/config/services.yaml b/NotificationsBundle/Resources/config/services.yaml index 8a84c1d..e447ee7 100644 --- a/NotificationsBundle/Resources/config/services.yaml +++ b/NotificationsBundle/Resources/config/services.yaml @@ -6,11 +6,11 @@ services: tags: ['doctrine.repository_service'] # Services : alias - Bluesquare\NotificationsBundle\Service\FooService: '@bluesquare.notifications_bundle.foo' + Bluesquare\NotificationsBundle\Service\NotificationsService: '@bluesquare.notifications_bundle.notifssrv' # Services : params - bluesquare.notifications_bundle.foo: - class: Bluesquare\NotificationsBundle\Service\FooService + bluesquare.notifications_bundle.notifssrv: + class: Bluesquare\NotificationsBundle\Service\NotificationsService autowire: true public: true - arguments: ['@request_stack'] \ No newline at end of file + arguments: ['@doctrine.orm.entity_manager'] \ No newline at end of file diff --git a/NotificationsBundle/Service/FooService.php b/NotificationsBundle/Service/FooService.php deleted file mode 100644 index 93fee07..0000000 --- a/NotificationsBundle/Service/FooService.php +++ /dev/null @@ -1,20 +0,0 @@ -em = $em; + } + + public function notifyUsers() + { + return 'bar'; + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index 25b4d4a..3fce2e4 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,8 @@ "license": "proprietary", "authors": [ { - "name": "RENOU Maxime", - "email": "maxime@bluesquare.io" + "name": "COMBALDIEU Paul", + "email": "paul@bluesquare.io" } ], "type": "symfony-bundle",