You are here

function twilio_user_load in Twilio 7

Implements hook_user_load().

File

./twilio.user.inc, line 24
Twilio user account and registration related functionality

Code

function twilio_user_load($users) {

  // Load data from the {twilio_user} table for the user account.
  $result = db_select('twilio_user', 'u')
    ->fields('u', array(
    'uid',
    'country',
    'number',
    'status',
    'code',
  ))
    ->condition('uid', array_keys($users), 'IN')
    ->execute();
  foreach ($result as $record) {
    if (!empty($record->uid)) {

      // Assign the twilio data to the user object.
      $users[$record->uid]->twilio_user = (array) $record;
    }
  }
}