You are here

public static function SelectQueryResult::createSingle in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 src/SelectQueryResult.php \Drupal\salesforce\SelectQueryResult::createSingle()
  2. 5.0.x src/SelectQueryResult.php \Drupal\salesforce\SelectQueryResult::createSingle()

Convenience method a SelectQueryResult from a single SObject record.

Parameters

\Drupal\salesforce\SObject $record: The record to be created.

Return value

\Drupal\salesforce\SelectQueryResult A query result containing the given record.

1 call to SelectQueryResult::createSingle()
QueueHandler::getSingleUpdatedRecord in modules/salesforce_pull/src/QueueHandler.php
Given a single mapping/id pair, enqueue it.

File

src/SelectQueryResult.php, line 69

Class

SelectQueryResult
Class SelectQueryResult.

Namespace

Drupal\salesforce

Code

public static function createSingle(SObject $record) {
  $results = [
    'totalSize' => 1,
    'done' => TRUE,
    'records' => [],
  ];
  $result = new static($results);
  $result->records[(string) $record
    ->id()] = $record;
  return $result;
}