You are here

public function SelectQueryResult::__construct in Salesforce Suite 5.0.x

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

SelectQueryResult constructor.

Parameters

array $results: The query results.

File

src/SelectQueryResult.php, line 46

Class

SelectQueryResult
Class SelectQueryResult.

Namespace

Drupal\salesforce

Code

public function __construct(array $results) {
  $this->totalSize = $results['totalSize'];
  $this->done = $results['done'];
  if (!$this->done) {
    $this->nextRecordsUrl = $results['nextRecordsUrl'];
  }
  $this->records = [];
  foreach ($results['records'] as $record) {
    if ($sobj = SObject::createIfValid($record)) {
      $this->records[$record['Id']] = $sobj;
    }
  }
}