You are here

function _pmtimetracking_get_drupal_uid_from_pmperson_nid in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pmtimetracking/includes/pmtimetracking.migrate.inc \_pmtimetracking_get_drupal_uid_from_pmperson_nid()
  2. 7.2 pmtimetracking/includes/pmtimetracking.migrate.inc \_pmtimetracking_get_drupal_uid_from_pmperson_nid()

Give back the corresponding drupal uid for a pmperson id.

File

pmtimetracking/includes/pmtimetracking.migrate.inc, line 138
Migration functions for the PM Timetracking module.

Code

function _pmtimetracking_get_drupal_uid_from_pmperson_nid($nid) {
  $r = db_select('pmperson', 'p')
    ->fields('p')
    ->condition('p.nid', $nid)
    ->execute()
    ->fetchAssoc();
  $uid = empty($r) ? FALSE : $r->user_uid;
  return $uid;
}