public function QueueHandler::doSfoQuery in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_pull/src/QueueHandler.php \Drupal\salesforce_pull\QueueHandler::doSfoQuery()
- 8.3 modules/salesforce_pull/src/QueueHandler.php \Drupal\salesforce_pull\QueueHandler::doSfoQuery()
Perform the SFO Query for a mapping and its mapped fields.
Parameters
\Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping: Mapping for which to execute pull.
array $mapped_fields: Fetch only these fields, if given, otherwise fetch all mapped fields.
int $start: Timestamp of starting window from which to pull records. If omitted, use ::getLastPullTime().
int $stop: Timestamp of ending window from which to pull records. If omitted, use "now".
Return value
\Drupal\salesforce\SelectQueryResult returned result object from Salesforce
See also
1 call to QueueHandler::doSfoQuery()
- QueueHandler::getUpdatedRecordsForMapping in modules/
salesforce_pull/ src/ QueueHandler.php - Fetch and enqueue records from Salesforce.
File
- modules/
salesforce_pull/ src/ QueueHandler.php, line 226
Class
- QueueHandler
- Handles pull cron queue set up.
Namespace
Drupal\salesforce_pullCode
public function doSfoQuery(SalesforceMappingInterface $mapping, array $mapped_fields = [], $start = 0, $stop = 0) {
// @TODO figure out the new way to build the query.
// Execute query.
try {
$soql = $mapping
->getPullQuery($mapped_fields, $start, $stop);
$this->eventDispatcher
->dispatch(new SalesforceQueryEvent($mapping, $soql), SalesforceEvents::PULL_QUERY);
return $this->sfapi
->query($soql);
} catch (\Exception $e) {
$message = '%type: @message in %function (line %line of %file).';
$args = Error::decodeException($e);
$this->eventDispatcher
->dispatch(new SalesforceErrorEvent($e, $message, $args), SalesforceEvents::ERROR);
}
}