diff options
Diffstat (limited to 'app/Model/NotificationType.php')
-rw-r--r-- | app/Model/NotificationType.php | 16 |
1 files changed, 16 insertions, 0 deletions
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]); + }); + } } |