Message Class

class Message

Represents a message

__construct(Participant $sender, string $message, Arrow $arrow, ?Participant $recipient = null, ?Activation $activation = null)

Create a new Message instance

Parameters:
  • $sender (Participant) – Message sender

  • $message (string) – The message

  • $arrow (Arrow) – The message arrow

  • $recipient (?Participant) – Message recipient (default: Recipient to be set using withRecipient())

  • $activation (?Activation) – Whether to activate the recipient or deactivate the sender (default: no action)

Returns:

A new Message instance

Return type:

Message

destroy(Destroy $destroy)

Destroy the sender or recipient of the message

Parameters:
  • $destroy (Destroy) – Whether to destroy the recipient or the sender

Returns:

A new Message instance that will destroy the recipient or the sender

Return type:

Message

withRecipient(Participant $recipient)

Create the message recipient

Note

The message must have a recipient set either in the constructor or this method

Parameters:
Returns:

A new Message instance that will create the recipient

Return type:

Message