From 09da289c2fb18475f372bee24e885617da484e0b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 17 Oct 2015 22:19:49 -0400 Subject: Move slack, hipchat and jabber integrations to plugins --- app/Model/NotificationType.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/Model/NotificationType.php') diff --git a/app/Model/NotificationType.php b/app/Model/NotificationType.php index e05cc686..bc9c6fdc 100644 --- a/app/Model/NotificationType.php +++ b/app/Model/NotificationType.php @@ -108,4 +108,20 @@ abstract class NotificationType extends Base { return $this->hiddens; } + + /** + * Keep only loaded notification types + * + * @access public + * @param string[] $types + * @return array + */ + public function filterTypes(array $types) + { + $classes = $this->classes; + + return array_filter($types, function($type) use ($classes) { + return isset($classes[$type]); + }); + } } -- cgit v1.2.3