You are here

function invite_save in Invite 7.2

Same name and namespace in other branches
  1. 5.2 invite.module \invite_save()
  2. 5 invite.module \invite_save()
  3. 6.2 invite.module \invite_save()
  4. 7.4 invite.module \invite_save()

Save an invite to the database.

Parameters

$edit: Associative array of data to store.

Return value

The result of the database operation.

4 calls to invite_save()
example_create_invite in ./invite.api.php
Create an invite.
example_modify_invite in ./invite.api.php
Modify an invite.
invite_send in ./invite.module
Send an invite.
invite_user_form_submit in ./invite.module
Implements the submit function associated with user_profile_form.

File

./invite.module, line 547
Allows your users to send and track invitations to join your site.

Code

function invite_save(&$invite) {
  $invite->is_new = empty($invite->iid);
  $data = $invite->data;
  $invite->data = serialize($data);
  if (!$invite->is_new) {
    drupal_write_record('invite', $invite, 'iid');
  }
  else {
    $invite->created = REQUEST_TIME;
    drupal_write_record('invite', $invite);
  }
  $invite->data = $data;
  $invite->inviter = user_load($invite->uid);
  return $invite;
}