You are here

protected function PullController::populateQueue in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_pull/src/Controller/PullController.php \Drupal\salesforce_pull\Controller\PullController::populateQueue()
  2. 5.0.x modules/salesforce_pull/src/Controller/PullController.php \Drupal\salesforce_pull\Controller\PullController::populateQueue()

Helper method to populate queue, optionally by mapping or a single record.

1 call to PullController::populateQueue()
PullController::endpoint in modules/salesforce_pull/src/Controller/PullController.php
Page callback to process push queue for a given mapping.

File

modules/salesforce_pull/src/Controller/PullController.php, line 162

Class

PullController
Push controller.

Namespace

Drupal\salesforce_pull\Controller

Code

protected function populateQueue(SalesforceMappingInterface $mapping = NULL, SFID $id = NULL) {
  $mappings = [];
  if ($id) {
    return $this->queueHandler
      ->getSingleUpdatedRecord($mapping, $id, TRUE);
  }
  if ($mapping != NULL) {
    $mappings[] = $mapping;
  }
  else {
    $mappings = $this->mappingStorage
      ->loadByProperties([
      "pull_standalone" => TRUE,
    ]);
  }
  foreach ($mappings as $mapping) {
    $this->queueHandler
      ->getUpdatedRecordsForMapping($mapping);
  }
}