public function getMessage($type, $id = null)
    {
        $result = null;
        if (null === $id) {
            if (array_key_exists($type, $this->messages)) {
                $result = $this->messages[$type];

                if (!$this->persistMessages) {
                    unset($this->messages[$type]);
                }
            }
        }

        if (null !== $id) {
            if (array_key_exists($type, $this->messages)) {
                if (array_key_exists($id, $this->messages[$type])) {
                    $result = $this->messages[$type][$id];
                    if (!$this->persistMessages) {
                        unset($this->messages[$type][$id]);
                    }
                }
            }
        }

        return $result;
    }
public function getMessage($type, $id = null)
    {
        $result = null;
        if (null === $id) {
            if (array_key_exists($type, $this->messages)) {
                $result = $this->messages[$type];

                if (!$this->persistMessages) {
                    unset($this->messages[$type]);
                }
            }
        }

        if (null !== $id) {
            if (array_key_exists($type, $this->messages)) {
                if (array_key_exists($id, $this->messages[$type])) {
                    $result = $this->messages[$type][$id];
                    if (!$this->persistMessages) {
                        unset($this->messages[$type][$id]);
                    }
                }
            }
        }

        return $result;
    }
public function getMessage ( $ type , $ id = null ) { $ result = null ; if ( null === $ id ) { if ( array_key_exists ( $ type , $ this -> messages ) ) { $ result = $ this -> messages [ $ type ] ; if ( ! $ this -> persistMessages ) { unset ( $ this -> messages [ $ type ] ) ; } } } if ( null !== $ id ) { if ( array_key_exists ( $ type , $ this -> messages ) ) { if ( array_key_exists ( $ id , $ this -> messages [ $ type ] ) ) { $ result = $ this -> messages [ $ type ] [ $ id ] ; if ( ! $ this -> persistMessages ) { unset ( $ this -> messages [ $ type ] [ $ id ] ) ; } } } } return $ result ; }
Retrieve a message

@param mixed $type The type of the messages to retrieve.
@param string $id The ID of the message
@return null|Message|\Wave\Framework\Flash\Message[]
Retrieve a message