Add messages

@param \BisonLab\SakonninBundle\Entity\Message $messages
@return MessageType
327479
public function addMessage(\BisonLab\SakonninBundle\Entity\Message $messages)
    {
        $this->messages[] = $messages;

        return $this;
    }
1353630
public function addMessage($item, $message = null)
    {
        if ($message === null || $message === '') {
            return $this;
        }
        if (!array_key_exists($item, $this->messages)) {
            $this->messages[$item] = array();
        }
        $this->messages[$item][] = $message;

        return $this;
    }
292145
public function add_term_updated_messages( $messages ) {
		$messages[ $this->taxonomy ] = [
			0 => '',
			/* translators: %s: Singular taxonomy name */
			1 => sprintf( __( '%s added.', 'mind/types' ), $this->name_singular ),
			/* translators: %s: Singular taxonomy name */
			2 => sprintf( __( '%s deleted.', 'mind/types' ), $this->name_singular ),
			/* translators: %s: Singular taxonomy name */
			3 => sprintf( __( '%s updated.', 'mind/types' ), $this->name_singular ),
			/* translators: %s: Singular taxonomy name */
			4 => sprintf( __( '%s not added.', 'mind/types' ), $this->name_singular ),
			/* translators: %s: Singular taxonomy name */
			5 => sprintf( __( '%s not updated.', 'mind/types' ), $this->name_singular ),
			/* translators: %s: Plural taxonomy name */
			6 => sprintf( __( '%s deleted.', 'mind/types' ), $this->name_plural ),
		];

		return $messages;
	}
1278533
public function addMessage($message, $type)
    {
        if (!is_string($message)) {
            throw new \InvalidArgumentException('Message must be a string');
        }
        if (!$message) {
            throw new \InvalidArgumentException('Message can\'t be empty');
        }
        if (!is_string($type)) {
            throw new \InvalidArgumentException('Type must be a string');
        }
        if (!$type) {
            throw new \InvalidArgumentException('Type can\'t be empty');
        }
        $this->messages[$type][] = $message;

        return $this;
    }
350067
public function addMessagesPackageReceived(\Sopinet\ChatBundle\Entity\MessagePackage $messagesPackageReceived)
    {
        $this->messagesPackageReceived[] = $messagesPackageReceived;

        return $this;
    }
946813
public function addMessages(array $messages, $prepend = false)
    {
        if ($prepend) {
            $messages = array_reverse($messages);
        }

        foreach ($messages as $message) {
            $this->addMessage($message, $prepend);
        }

        return $this;
    }
532035
protected function addMessage($message = '', $type = 'info')
    {
        $type = strip_tags($type);

        if (empty($message) || ! in_array($type, $this->types)) {
            return $this;
        }

        if ( ! array_key_exists($type, $_SESSION[$this->key])) {
            $_SESSION[$this->key][$type] = [];
        }

        $_SESSION[$this->key][$type][] = $message;

        return $this;
    }
689831
public function setMessages($locale, $messages)
    {
        $this->loadMessagesFromFile($locale);
        $this->addResource('array', $messages, $locale);
        $this->messages[$locale] = array_merge(
            isset($this->messages[$locale]) ? $this->messages[$locale] : [],
            $messages
        );

        return $this;
    }
680277
protected function add($type, $message, ...$text): void
    {
        $this->getMessagesStore()[$type][] = Translator::translate($message, ...$text);
    }
406966
public function add($message, $type = 'error')
    {
        $this->session[$this->prefix][] = ['message' => $message, 'type' => $type];

        return $this;
    }
680901
public function appendMessage($message)
    {
        $context = $this->_context;

        $context->messages[$message->field][] = $message;

        return $this;
    }
788501
public function addErrors($messages = [])
	{
		// check if messages are an array
		if(! is_array($messages) && ! $messages instanceof MessageProvider)
		{
			$messages = (array) $messages;
		}

		return $this->errors->merge($this->resolveErrorKey($messages));
	}
256643
public function add($message = null, $type = 'notice')
    {
        if (!isset($this->messages[$type]) || !is_array($this->messages[$type])) {
            $this->messages[$type] = [];
        }
        if ($message) {
            $this->messages[$type][] = $message;
        }
        $this->writeToSession();
        return $this;
    }
991001
public function add(Message $message, $groupName = null) {
		if (!isset($this->messages[$groupName])) {
			$this->messages[$groupName] = array();
		}	
		
		$this->messages[$groupName][] = $message;
	}
413549
public function setMessages(Mage_Core_Model_Message_Collection $messages) {
        if ($this->_fixMessages()) {
            $this->_saveMessages($messages->getItems());
        } else {
            parent::setMessages($messages);
        }
        return $this;
    }
956019
public function setMessages(array $messages)
    {
        $this->unsetMessages();
        foreach ($messages as $message) {
            $this->appendMessage($message);
        }

        return $this;
    }
700400
public function addMessage($message) {
        if (!is_array(self::$_store->messages)) {
            self::$_store->messages = array();
        }
        $messages = self::$_store->messages;
        // Duplicates are wack
        if (in_array($message, $messages)) {
            return $this;
        }
        $messages[] = $message;
        self::$_store->messages = $messages;
        return $this;
    }