You are here

public function SelectQueryResult::record in Salesforce Suite 8.3

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

Fetch a particular record given its SFID.

Parameters

\Drupal\salesforce\SFID $id: The SFID.

Return value

\Drupal\salesforce\SObject The record.

Throws

\Exception If the given SFID doesn't exist in these results.

File

src/SelectQueryResult.php, line 103

Class

SelectQueryResult
Class SelectQueryResult.

Namespace

Drupal\salesforce

Code

public function record(SFID $id) {
  if (!isset($this->records[(string) $id])) {
    throw new \Exception('No record found');
  }
  return $this->records[(string) $id];
}