You are here

public function RestResponseDescribe::getField in Salesforce Suite 8.3

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

Return a field definition for the given field name.

A single Salesforce field may contain the following keys: aggregatable autoNumber byteLength calculated calculatedFormula cascadeDelete caseSensitive controllerName createable custom defaultValue defaultValueFormula defaultedOnCreate dependentPicklist deprecatedAndHidden digits displayLocationInDecimal encrypted externalId extraTypeInfo filterable filteredLookupInfo groupable highScaleNumber htmlFormatted idLookup inlineHelpText label length mask maskType name nameField namePointing nillable permissionable picklistValues precision queryByDistance referenceTargetField referenceTo relationshipName relationshipOrder restrictedDelete restrictedPicklist scale soapType sortable type unique updateable writeRequiresMasterRead.

For more information

Parameters

string $field_name: A field name.

Return value

array The field definition.

Throws

\Exception If field_name is not defined for this SObject type.

See also

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode....

File

src/Rest/RestResponseDescribe.php, line 146

Class

RestResponseDescribe
Class RestResponseDescribe.

Namespace

Drupal\salesforce\Rest

Code

public function getField($field_name) {
  if (empty($this->fields[$field_name])) {
    throw new \Exception("No field {$field_name}");
  }
  return $this->fields[$field_name];
}