public function hasMessages($type = null)
    {
        if ( ! is_null($type)) {
            return ! empty($_SESSION[$this->key][$type]);
        }
        
        foreach ($this->types as $type) {
            if ( ! empty($_SESSION[$this->key][$type])) {
                return true;
            }
        }

        return false;
    }
public function hasMessages($type = null)
    {
        if ( ! is_null($type)) {
            return ! empty($_SESSION[$this->key][$type]);
        }
        
        foreach ($this->types as $type) {
            if ( ! empty($_SESSION[$this->key][$type])) {
                return true;
            }
        }

        return false;
    }
public function hasMessages ( $ type = null ) { if ( ! is_null ( $ type ) ) { return ! empty ( $ _SESSION [ $ this -> key ] [ $ type ] ) ; } foreach ( $ this -> types as $ type ) { if ( ! empty ( $ _SESSION [ $ this -> key ] [ $ type ] ) ) { return true ; } } return false ; }
Returns if there are any messages in container.

@param string $type - message type: success, info, warning, error

@return bool
Returns if there are any messages in container .