You are here

function pmperson_load in Drupal PM (Project Management) 7

Implements hook_load().

File

pmperson/pmperson.module, line 532

Code

function pmperson_load($nodes) {
  foreach ($nodes as $nid => &$node) {
    $result = db_select('pmperson', 'spe')
      ->fields('spe')
      ->condition('spe.vid', $node->vid)
      ->execute();
    $record = $result
      ->fetchAssoc();
    foreach ($record as $key => $value) {
      $node->{$key} = $value;
    }
    $ass_user = user_load($node->user_uid);
    $node->user_name = $ass_user->name;
    $node->title_old = $node->title;
  }
}