You are here

public function SObject::field in Salesforce Suite 8.3

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

Given $key, return corresponding field value.

Return value

mixed The value.

Throws

\Exception If $key is not found.

File

src/SObject.php, line 87

Class

SObject
Class SObject.

Namespace

Drupal\salesforce

Code

public function field($key) {
  if (!array_key_exists($key, $this->fields)) {
    throw new \Exception('Index not found');
  }
  return $this->fields[$key];
}