You are here

function messaging_store_save_object in Messaging 6.3

Save object

1 call to messaging_store_save_object()
messaging_store_save in ./messaging.store.inc
Put into database storage, create one line for each destination

File

./messaging.store.inc, line 255
Database storage for the messaging framework

Code

function messaging_store_save_object($object, $table, $key, $fields = NULL) {

  // Serialize fields
  if ($fields) {
    foreach ($fields as $field) {
      if (isset($object->{$field})) {
        $object->data[$field] = $object->{$field};
      }
    }
  }

  // Create / update depending on key field
  if (empty($object->{$key})) {
    $update = array();
    $object->created = $object->updated = time();
  }
  else {
    $update = $key;
    $object->updated = time();
  }
  return drupal_write_record($table, $object, $update);
}