You are here

function sms_user_delete_user_info in SMS Framework 7

Deletes a user's mobile information from the database.

Parameters

int|object $uid: The uid of the user who's data is to be removed.

string|bool $number: The number to delete. Defaults to FALSE which will delete all numbers.

Return value

bool|int

See also

sms_user_user_cancel()

4 calls to sms_user_delete_user_info()
SmsSendToPhoneWebTest::testSendToPhoneFilter in modules/sms_sendtophone/sms_sendtophone.test
Tests sendtophone filter integration.
sms_user_settings_confirm_form_submit in modules/sms_user/sms_user.module
Submits the user number code verification form.
sms_user_settings_reset_form_submit in modules/sms_user/sms_user.module
Submits the verified user number reset form.
sms_user_user_delete in modules/sms_user/sms_user.module
Implements hook_user_delete().

File

modules/sms_user/sms_user.module, line 837
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_delete_user_info($uid, $number = FALSE) {
  if (is_object($uid)) {
    $uid = $uid->uid;
  }
  $query = db_delete('sms_user')
    ->condition('uid', $uid);
  if ($number) {
    $query
      ->condition('number', $number);
  }
  return $query
    ->execute();
}