function simplenews_scheduler_node_storage_load in Simplenews Scheduler 2.0.x
Same name and namespace in other branches
- 8 simplenews_scheduler.module \simplenews_scheduler_node_storage_load()
Implements hook_node_storage_load().
File
- ./
simplenews_scheduler.module, line 272 - 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 = \Drupal::database()
->select('simplenews_scheduler', 's')
->fields('s')
->condition('nid', $nids, 'IN')
->execute()
->fetchAll();
foreach ($result as $record) {
$nodes[$record->nid]->simplenews_scheduler = $record;
}
$result = \Drupal::database()
->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;
}
}