You are here

public function SchedulerManager::nidList in Scheduler 8

Gather node IDs for all nodes that need to be $action'ed.

Modules can implement hook_scheduler_nid_list($action) and return an array of node ids which will be added to the existing list.

Parameters

string $action: The action being performed, either "publish" or "unpublish".

Return value

array An array of node ids.

2 calls to SchedulerManager::nidList()
SchedulerManager::publish in src/SchedulerManager.php
Publish scheduled nodes.
SchedulerManager::unpublish in src/SchedulerManager.php
Unpublish scheduled nodes.

File

src/SchedulerManager.php, line 522

Class

SchedulerManager
Defines a scheduler manager.

Namespace

Drupal\scheduler

Code

public function nidList($action) {
  $nids = [];
  foreach ($this->moduleHandler
    ->getImplementations('scheduler_nid_list') as $module) {
    $function = $module . '_scheduler_nid_list';
    $nids = array_merge($nids, $function($action));
  }
  return $nids;
}