You are here

function Messaging_Message::add_user in Messaging 7

Add user as a destination

Parameters

$user: User object

Return value

Messaging_Destination Returns the destination if successfully added

2 calls to Messaging_Message::add_user()
Messaging_Message::add_user_list in ./messaging.message.inc
Add list of users as destinations
Messaging_Message::set_user in ./messaging.message.inc
Set user, if the message is intended for a single user try to find suitable method

File

./messaging.message.inc, line 139
Drupal Messaging Framework - Message class file

Class

Messaging_Message
Message class

Code

function add_user($user) {
  if ($destination = $this
    ->send_method()
    ->user_destination($user)) {
    $this
      ->add_destination($destination);
  }
  return $this;
}