You are here

function biblio_pm_node_load in Bibliography Module 7

File

modules/pubmed/biblio_pm.module, line 494

Code

function biblio_pm_node_load($nodes, $types) {
  $result = db_select('biblio_pubmed', 'bpm')
    ->fields('bpm', array(
    'nid',
    'biblio_pubmed_id',
    'biblio_pmcid',
    'biblio_pubmed_md5',
  ))
    ->condition('nid', array_keys($nodes))
    ->execute();

  // $result = db_query('SELECT  biblio_pubmed_id  FROM {biblio_pubmed} WHERE nid IN(:nids)', array(':nids' => array_keys($nodes)));
  foreach ($result as $record) {
    $nodes[$record->nid]->biblio_pubmed_id = $record->biblio_pubmed_id;
    $nodes[$record->nid]->biblio_pmcid = $record->biblio_pmcid;
    $nodes[$record->nid]->biblio_pubmed_md5 = $record->biblio_pubmed_md5;
  }
  $result = db_select('biblio_pubmed_grant_info', 'bpmgi')
    ->fields('bpmgi')
    ->condition('nid', array_keys($nodes))
    ->execute();
  foreach ($result as $record) {
    $nodes[$record->nid]->biblio_pubmed_grants[] = array(
      'grantid' => $record->grantid,
      'acronym' => $record->acronym,
      'agency' => $record->agency,
      'country' => $record->country,
    );
  }
}