You are here

function pmorganization_load in Drupal PM (Project Management) 7

Implements hook_load().

File

pmorganization/pmorganization.module, line 441

Code

function pmorganization_load($nodes) {
  foreach ($nodes as $nid => &$node) {
    $result = db_select('pmorganization', 'sor')
      ->fields('sor')
      ->condition('vid', $node->vid)
      ->execute();
    $record = array();
    $record = $result
      ->fetchAssoc();
    if ($record) {
      foreach ($record as $key => $value) {
        $node->{$key} = $value;
      }
    }
    $node->title_old = $node->title;
  }
}