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

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

Check if a message is set for given type.
public has ( $type = null ) : boolean
$type
Результат boolean
    public function has($type = null)
    {
        if ($this->count() === 0) {
            return false;
        }
        if (is_null($type)) {
            return true;
        }
        if (!$this->typeIsAvailable($type)) {
            return false;
        }
        foreach ($this->notifications as $key => $message) {
            if ($message->getType() == $type) {
                return true;
            }
        }
        return false;
    }