You are here

public function SalesforceCommands::listObjects in Salesforce Suite 8.3

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

List the objects that are available in your organization.

@command salesforce:list-objects @aliases sflo,sf-list-objects @field-labels activateable: Activateable createable: Createable custom: Custom customSetting: CustomSetting deletable: Deletable deprecatedAndHidden: DeprecatedAndHidden feedEnabled: FeedEnabled hasSubtypes: HasSubtypes isSubtype: IsSubtype keyPrefix: KeyPrefix label: Label labelPlural: LabelPlural layoutable: Layoutable mergeable: Mergeable mruEnabled: MruEnabled name: Name queryable: Queryable replicateable: Replicateable retrieveable: Retrieveable searchable: Searchable triggerable: Triggerable undeletable: Undeletable updateable: Updateable urls: URLs @default-fields name,label,labelPlural

Return value

\Consolidation\OutputFormatters\StructuredData\RowsOfFields The objects.

File

src/Commands/SalesforceCommands.php, line 93

Class

SalesforceCommands
A Drush commandfile.

Namespace

Drupal\salesforce\Commands

Code

public function listObjects() {
  if ($objects = $this->client
    ->objects()) {
    foreach ($objects as $name => $object) {
      $rows[$name] = $object;
      $rows[$name]['urls'] = new TableCell(implode("\n", $rows[$name]['urls']) . "\n");
    }
    return new RowsOfFields($rows);
  }
  throw new \Exception('Could not load any information about available objects.');
}