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;
    }
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;
    }
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 ; }
Check if a message is set for given type.

@param $type
@return bool
Check if a message is set for given type .