You are here

public function RestResponse::__get in Salesforce Suite 5.0.x

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

Magic getter method to return the given property.

Parameters

string $key: The property name.

Return value

mixed The property value.

Throws

\Exception If $key property does not exist.

File

src/Rest/RestResponse.php, line 59

Class

RestResponse
Class RestResponse.

Namespace

Drupal\salesforce\Rest

Code

public function __get($key) {
  if (!property_exists($this, $key)) {
    throw new \Exception("Undefined property {$key}");
  }
  return $this->{$key};
}