From 3ca4cac616def9478ed15149f344c6d8df0c256f Mon Sep 17 00:00:00 2001 From: Adrian Dumitrache Date: Sat, 24 Aug 2024 03:01:47 +0300 Subject: [PATCH] [SonataExtraBundle] Add info notification (#289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Martin Poirier Théorêt --- .../ActionableAdmin/ExecutionNotifier.php | 5 +---- .../Notifier/Notification/SonataNotification.php | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sonata-extra-bundle/ActionableAdmin/ExecutionNotifier.php b/packages/sonata-extra-bundle/ActionableAdmin/ExecutionNotifier.php index e0590ca9..e8d724a1 100644 --- a/packages/sonata-extra-bundle/ActionableAdmin/ExecutionNotifier.php +++ b/packages/sonata-extra-bundle/ActionableAdmin/ExecutionNotifier.php @@ -75,10 +75,7 @@ public function notifyExecution(ObjectActionExecutioner $objectActionExecutioner 'DrawSonataExtraBundle' ); - $this->notifier->send( - (new SonataNotification($subject)) - ->setSonataFlashType('info') - ); + $this->notifier->send(SonataNotification::info($subject)); } } diff --git a/packages/sonata-extra-bundle/Notifier/Notification/SonataNotification.php b/packages/sonata-extra-bundle/Notifier/Notification/SonataNotification.php index ca337205..81721178 100644 --- a/packages/sonata-extra-bundle/Notifier/Notification/SonataNotification.php +++ b/packages/sonata-extra-bundle/Notifier/Notification/SonataNotification.php @@ -13,6 +13,11 @@ public static function success(string $message): self return (new self($message))->setSonataFlashType('success'); } + public static function info(string $message): self + { + return (new self($message))->setSonataFlashType('info'); + } + public static function error(string $message): self { return (new self($message))->setSonataFlashType('error');