You are here

public function QueueHandler::enqueueAllResults in Salesforce Suite 8.4

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

Inserts the given records into pull queue.

Parameters

\Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping: Mapping.

\Drupal\salesforce\SelectQueryResult $results: Results.

bool $force_pull: Force flag.

2 calls to QueueHandler::enqueueAllResults()
QueueHandler::getSingleUpdatedRecord in modules/salesforce_pull/src/QueueHandler.php
Given a single mapping/id pair, enqueue it.
QueueHandler::getUpdatedRecordsForMapping in modules/salesforce_pull/src/QueueHandler.php
Fetch and enqueue records from Salesforce.

File

modules/salesforce_pull/src/QueueHandler.php, line 254

Class

QueueHandler
Handles pull cron queue set up.

Namespace

Drupal\salesforce_pull

Code

public function enqueueAllResults(SalesforceMappingInterface $mapping, SelectQueryResult $results, $force_pull = FALSE) {
  while (!$this
    ->enqueueResultSet($mapping, $results, $force_pull)) {
    try {
      $results = $this->sfapi
        ->queryMore($results);
    } catch (\Exception $e) {
      $message = '%type: @message in %function (line %line of %file).';
      $args = Error::decodeException($e);
      $this->eventDispatcher
        ->dispatch(SalesforceEvents::ERROR, new SalesforceErrorEvent($e, $message, $args));

      // @TODO do we really want to eat this exception here?
      return;
    }
  }
}