We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 166b30e + a0856e4 commit b61850fCopy full SHA for b61850f
src/Krucas/Notification/NotificationsBag.php
@@ -607,6 +607,31 @@ public function count()
607
return count($this->notifications);
608
}
609
610
+ /**
611
+ * Check if a message is set for given type.
612
+ *
613
+ * @param $type
614
+ * @return bool
615
+ */
616
+ public function has($type = null)
617
+ {
618
+ if( $this->count() === 0 )
619
+ return false;
620
+
621
+ if (is_null($type) )
622
+ return true;
623
624
+ if( !$this->typeIsAvailable($type) )
625
626
627
+ foreach ($this->notifications as $key => $message) {
628
+ if ($message->getType() == $type)
629
630
+ }
631
632
633
634
635
/**
636
* Fire event for a given message.
637
*
0 commit comments