public function has($type = null)
    {
        if ($type === null) {
            return !empty($this->session[$this->prefix]);
        }

        foreach ($this->session[$this->prefix] as $message) {
            if ($message['type'] === $type) {
                return true;
            }
        }

        return false;
    }
public function has($type = null)
    {
        if ($type === null) {
            return !empty($this->session[$this->prefix]);
        }

        foreach ($this->session[$this->prefix] as $message) {
            if ($message['type'] === $type) {
                return true;
            }
        }

        return false;
    }
public function has ( $ type = null ) { if ( $ type === null ) { return ! empty ( $ this -> session [ $ this -> prefix ] ) ; } foreach ( $ this -> session [ $ this -> prefix ] as $ message ) { if ( $ message [ 'type' ] === $ type ) { return true ; } } return false ; }
Returns true if at least one message of set type exists

@param null|string $type

@return bool
Returns true if at least one message of set type exists