You are here

function invite_notifications_invite_withdraw in Invite 7.4

Invite Notifications.

@codingStandardsIgnoreStart

Parameters

Invite $invite: The Invite.

File

modules/invite_notifications/invite_notifications.module, line 189
Main file for the Invite Notifications.

Code

function invite_notifications_invite_withdraw($invite) {

  //@codingStandardsIgnoreEnd
  if ($invite->invitee != 0) {
    $uid = db_select('invite_notifications')
      ->fields('invite_notifications', array(
      'uid',
    ))
      ->condition('iid', $invite->iid)
      ->execute()
      ->fetchField();
    db_delete('invite_notifications')
      ->condition('iid', $invite->iid)
      ->execute();
    $user = user_load($uid);
    if (!_invite_notifications_user_messages($user)) {
      user_save($user, array(
        'data' => array(
          'notification_received' => FALSE,
        ),
      ));
    }
  }
}