function simplenews_scheduler_node_storage_load in Simplenews Scheduler 8
Same name and namespace in other branches
- 2.0.x simplenews_scheduler.module \simplenews_scheduler_node_storage_load()
Implements hook_node_storage_load().
File
- ./
simplenews_scheduler.module, line 270 - Simplenews Scheduler module allows a schedule to be set for sending (and resending) a Simplenews item.
Code
function simplenews_scheduler_node_storage_load($nodes) {
$nids = array_keys($nodes);
$result = db_select('simplenews_scheduler', 's')
->fields('s')
->condition('nid', $nids, 'IN')
->execute()
->fetchAll();
foreach ($result as $record) {
$nodes[$record->nid]->simplenews_scheduler = $record;
}
$result = db_select('simplenews_scheduler_editions', 's')
->fields('s')
->condition('eid', $nids, 'IN')
->execute()
->fetchAll();
foreach ($result as $record) {
$nodes[$record->eid]->simplenews_scheduler_edition = $record;
$nodes[$record->eid]->is_edition = TRUE;
$nodes[$record->eid]->simplenews_edition_parent = $record->pid;
}
}