Set / unset massage.

@param string $key
@param mixed  $message
@param int    $when [optional]

@return $this
501781
public function set($key, $message, $when = self::NEXT)
    {
        $this->validateWhen($when);

        if (null == $message) {
            if (isset($this->messages[$when][$key])) {
                unset($this->messages[$when][$key]);
                $this->save();
            }
        } elseif ($message) {
            $this->messages[$when][$key] = $message;
            $this->save();
        }

        return $this;
    }
910026
public function setStatusMessage($message)
    {
        $message = (string) trim($message);

        if ($message === '') {
            $this->statusMessage = $this->getStatusMessage();
        } else {
            $this->statusMessage = $message;
        }

        return $this;
    }
1142194
public function setMessage($message, $param=null)
    {
        if ($param) {
            $message = sprintf($message, $param);
        }
        $this->message = $message;
        
        return $this;
    }
207443
public function setFlash($key, $message)
    {
        if (!Session::has('flashMessages')) {
            return false;
        }

        if (!isset($key) || !isset($message[0])) {
            return false;
        }

        // Verify $key is a valid message type or not
        if (!in_array($key, $this->validFlashTypes)) {
            throw new \Exception('"'.strip_tags($key).'" is not a valid message type!');
        }

        // If the flash session array doesn't exist, make it
        if (!array_key_exists($key, Session::get('flashMessages'))) {
            Session::set('flashMessages', [$key => []]);
        }

        Session::set('flashMessages', [$key => [$message]]);

        return true;
    }
325433
public function hasArrayKeys($key, $message = null) {
        $key = s('%s.#', $key);

        return new StringNode($this, $key, $message);
    }
748421
public function unsetData($key = null)
    {
        if (is_string($key) && 0 < strlen($key)) {
            unset($this->data[$key]);
        } else {
            $this->data = [];
        }

        return $this;
    }
1132537
public function addLog($key, $message)
    {
        if (!is_string($message)) {
            throw new \InvalidArgumentException(sprintf(
                '[%s]: "message" must be type of string, %s given.',
                __METHOD__,
                gettype($message)
            ));
        }

        if (!isset($this->logs[$key])) {
            $this->logs[$key] = [];
        }

        $this->logs[$key][] = $message;

        return $this;
    }
165033
function del($key)
    {
        if ($this->has($key)) {
            $p = &$this->__attainInternalPointer();
            unset($p[$key]);
        }

        return $this;
    }
659956
public function deleteMessage($key, $language) {
		$messageFile = $this->getMessageLanguageForLanguage($language);
		$messageFile->deleteMessage($key);
		$messageFile->save();
	}
132613
public function addMessageNow($key, $message)
    {
        // Create Array for this key
        if (!isset($this->forNow[$key])) {
            $this->forNow[$key] = [];
        }

        // Push onto the array
        $this->forNow[$key][] = $message;
    }
255948
protected function unique($key, $message)
        {
            return !isset($this->messages[$key]) || !Arrays::in($message, $this->messages[$key]);
        }
1236576
public function overwrite($key, $message=null)
    {
        if (!is_array($key)) {
            $this->overwrites[$key] = $message;
            return $this;
        }

        foreach ($key as $k=>$v) {
            $this->overwrite($k, $v);
        }

        return $this;
    }
345358
public function setCode($code, $message)
    {
        $this->message = $message;
        $this->code    = (int)$code;

        return $this;
    }
50384
public function setMessages(array $messages)
    {
        foreach ($messages as $key => $message) {
            $this->setMessage($message, $key);
        }
        return $this;
    }
411676
protected function setCliMessage($message)
    {
        if (GC_CLI) {
            $this->cli->line($this->translation->text($message));
        }
    }
850794
public function setMessage($message)
    {
        if ($message === null) {
            $this->message = null;
        } elseif (is_scalar($message) || method_exists($message, '__toString')) {
            $this->message = (string) $message;
        } else {
            throw new InvalidArgumentException('The message must be a string.');
        }

        return $this;
    }
700538
public function unsetOption($key)
    {
        //reset a single option if its set already
        if (isset($this->options[$key])) {
            unset($this->options[$key]);
        }

        return $this;
    }