You are here

function _pmperson_migrate_get_pmperson_from_uid in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_get_pmperson_from_uid()
  2. 7.3 pmperson/includes/pmperson.migrate.inc \_pmperson_migrate_get_pmperson_from_uid()

Load pmperson associated with a Drupal user.

2 calls to _pmperson_migrate_get_pmperson_from_uid()
pmperson_migrate_create_users_if_required in pmperson/includes/pmperson.migrate.inc
Creates Drupal User and associate it with pmperson node.
pmperson_migrate_fix_existing_users_form_submit in pmperson/includes/pmperson.migrate.inc
Form submit function for automatching Drupal users to PM Persons.

File

pmperson/includes/pmperson.migrate.inc, line 430
Migration functions for the PM Person module.

Code

function _pmperson_migrate_get_pmperson_from_uid($uid) {
  $record = db_select('pmperson', 'pmp')
    ->fields('pmp')
    ->condition('pmp.user_uid', $uid)
    ->execute()
    ->fetchAssoc();
  if ($record and $node = node_load($record['nid'])) {
    return $node;
  }
  return FALSE;
}