You are here

function fb_token_load in Drupal for Facebook 7.4

1 call to fb_token_load()
fb_debug_token in ./fb.module

File

./fb.module, line 375

Code

function fb_token_load($fbu, $fba = NULL) {
  if (!$fba) {
    $fb_app = fb_get_app();
    $fba = $fb_app['client_id'];
  }

  // Using db_query because I could not make db_select work with bigint fields.
  $result = db_query("SELECT * FROM {fb_token} WHERE fbu=:fbu AND fba=:fba", array(
    ':fbu' => $fbu,
    ':fba' => $fba,
  ));
  $fb_token = $result
    ->fetchAssoc();

  /*
  $select = db_select('fb_token', 'fbt')
    ->condition('fbu', (int) $fbu, '=');
  if ($fba) {
    $select->condition('fba', (int) $fba, '=');
  }
  $fb_token = $select->execute()->fetchAssoc();
  */
  return $fb_token;
}