public function clear($type = FALSE)
  {
    
	if ($type === FALSE){
		
		$this->_session_unset();
	}
	else {
		
		$messages = $this->_session_get();
		
		if (is_array($messages))
		{		
			foreach($messages as $i=>$message){
			
				if ($message->type == $type){
					
					unset($messages[$i]);
				}
			}
			
			if (!$this->count())
			{
				$this->clear();
			}
			else {
			
				$this->_session_set($messages);
			}
		}
	}
	
    return $this;
  }
public function clear($type = FALSE)
  {
    
	if ($type === FALSE){
		
		$this->_session_unset();
	}
	else {
		
		$messages = $this->_session_get();
		
		if (is_array($messages))
		{		
			foreach($messages as $i=>$message){
			
				if ($message->type == $type){
					
					unset($messages[$i]);
				}
			}
			
			if (!$this->count())
			{
				$this->clear();
			}
			else {
			
				$this->_session_set($messages);
			}
		}
	}
	
    return $this;
  }
public function clear ( $ type = FALSE ) { if ( $ type === FALSE ) { $ this -> _session_unset ( ) ; } else { $ messages = $ this -> _session_get ( ) ; if ( is_array ( $ messages ) ) { foreach ( $ messages as $ i => $ message ) { if ( $ message -> type == $ type ) { unset ( $ messages [ $ i ] ) ; } } if ( ! $ this -> count ( ) ) { $ this -> clear ( ) ; } else { $ this -> _session_set ( $ messages ) ; } } } return $ this ; }
Removes messages from the list.

If $type is given, clears only messages of that type
If $type is not given, clears all messages

@param string $type type of messages to remove
@return $this
Removes messages from the list .