Krucas\Notification\NotificationsBag::clear PHP Метод

clear() публичный Метод

Clears message for a given type.
public clear ( null $type = null ) : NotificationsBag
$type null
Результат NotificationsBag
    public function clear($type = null)
    {
        if (is_null($type)) {
            $this->notifications = new Collection();
        } else {
            $notifications = new Collection();
            foreach ($this->notifications as $message) {
                if ($message->getType() != $type) {
                    $notifications->add($message);
                }
            }
            $this->notifications = $notifications;
        }
        return $this;
    }