protected function SalesforceMappingFormCrudBase::getSalesforceObjectTypeOptions in Salesforce Suite 8.4
Same name and namespace in other branches
- 5.0.x modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormCrudBase.php \Drupal\salesforce_mapping_ui\Form\SalesforceMappingFormCrudBase::getSalesforceObjectTypeOptions()
Helper to retreive a list of object type options.
Return value
array An array of values keyed by machine name of the object with the label as the value, formatted to be appropriate as a value for #options.
Overrides SalesforceMappingFormBase::getSalesforceObjectTypeOptions
1 call to SalesforceMappingFormCrudBase::getSalesforceObjectTypeOptions()
- SalesforceMappingFormCrudBase::buildForm in modules/
salesforce_mapping_ui/ src/ Form/ SalesforceMappingFormCrudBase.php - Form constructor.
File
- modules/
salesforce_mapping_ui/ src/ Form/ SalesforceMappingFormCrudBase.php, line 462
Class
- SalesforceMappingFormCrudBase
- Salesforce Mapping Form base.
Namespace
Drupal\salesforce_mapping_ui\FormCode
protected function getSalesforceObjectTypeOptions() {
$sfobject_options = [];
// Note that we're filtering SF object types to a reasonable subset.
$config = $this
->config('salesforce.settings');
$filter = $config
->get('show_all_objects') ? [] : [
'updateable' => TRUE,
'triggerable' => TRUE,
];
$sfobjects = $this->client
->objects($filter);
foreach ($sfobjects as $object) {
$sfobject_options[$object['name']] = $object['label'] . ' (' . $object['name'] . ')';
}
asort($sfobject_options);
return $sfobject_options;
}