You are here

function message_instance_save in Message 6

Message instance save.

Parameters

$message_instance: A message instance object.

Return value

The saved message instance object.

3 calls to message_instance_save()
message_action_create_message_instance in includes/message.rules.inc
Action: Create a message instance.
message_data_type_message_instance::save in includes/message.rules.inc
Makes changes to the data permanent. Implement it, if your data type is savable.
message_save_message_to_realms in ./message.module
API function; Save a message instance and save it to realms.

File

./message.module, line 407
API functions to manipulate messages.

Code

function message_instance_save($message_instance) {
  if ($existing = message_instance_load($message_instance->iid)) {
    drupal_write_record('message_instance', $message_instance, 'iid');
  }
  else {
    $message_instance->timestamp = !empty($message_instance->timestamp) ? $message_instance->timestamp : time();
    drupal_write_record('message_instance', $message_instance);
  }
  return $message_instance;
}