You are here

public function PushQueue::processQueues in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::processQueues()
  2. 5.0.x modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::processQueues()

Process Salesforce queues.

File

modules/salesforce_push/src/PushQueue.php, line 402

Class

PushQueue
Salesforce push queue.

Namespace

Drupal\salesforce_push

Code

public function processQueues($mappings = []) {
  if (empty($mappings)) {
    $mappings = $this->mappingStorage
      ->loadPushMappings();
  }
  if (empty($mappings)) {
    return $this;
  }
  $i = 0;
  foreach ($mappings as $mapping) {
    $i += $this
      ->processQueue($mapping);
    if ($i >= $this->globalLimit) {
      break;
    }
  }
  return $this;
}