You are here

function salesforce_push_drush_command in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_push/salesforce_push.drush.inc \salesforce_push_drush_command()
  2. 8.3 modules/salesforce_push/salesforce_push.drush.inc \salesforce_push_drush_command()

Implements hook_drush_command().

File

modules/salesforce_push/salesforce_push.drush.inc, line 11
Drush tools for the Salesforce Push module.

Code

function salesforce_push_drush_command() {
  $items = [];
  $items['sf-push-queue'] = [
    'category' => 'salesforce',
    'description' => 'Process push queues (as though during cron) for one or all Salesforce Mappings.',
    'aliases' => [
      'sfpushq',
      'sfpm',
    ],
    'arguments' => [
      'name' => [
        'description' => 'Machine name of the Salesforce Mapping for which to process push queue. If omitted, process all queues.',
      ],
    ],
    'examples' => [
      'drush sfpushq' => 'Process all push queue items',
      'drush sfpushq foo' => 'Process push queue items for mapping "foo"',
    ],
  ];

  // Push entities in a mapping that have not yet been pushed.
  $items['salesforce-push-unmapped'] = [
    'description' => "Attempt to push entities of a mapped type that are not linked to Salesforce Objects.",
    'aliases' => [
      'sfpu',
    ],
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
    'core' => [
      '8+',
    ],
    'arguments' => [
      'mapping_id' => 'The Drupal machine name of the mapping for the entities.',
    ],
    'options' => [
      'count' => [
        'description' => 'The number of entities to try to sync. (Default is 50).',
        'example-value' => 42,
      ],
    ],
    'examples' => [
      'drush sfpu foo' => 'Push 50 drupal entities without mapped objects for mapping "foo"',
      'drush sfpu foo --count=42' => 'Push 42 unmapped drupal entities without mapped objects for mapping "foo"',
    ],
  ];
  return $items;
}