You are here

function gathercontent_drush_command in GatherContent 7.3

Same name and namespace in other branches
  1. 8.5 gathercontent.drush.inc \gathercontent_drush_command()
  2. 8.3 gathercontent.drush.inc \gathercontent_drush_command()
  3. 8.4 gathercontent.drush.inc \gathercontent_drush_command()

Implements hook_drush_command().

File

./gathercontent.drush.inc, line 14
Drush command to cli config import.

Code

function gathercontent_drush_command() {
  $commands = [];
  $commands['gathercontent-list-mappings'] = [
    'aliases' => [
      'gc-lm',
    ],
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
    'description' => dt('Lists the available mapping definitions.'),
    'engines' => [
      'outputformat' => [
        'default' => 'table',
        'pipe-format' => 'json',
        'output-data-type' => 'format-table',
        'field-labels' => [
          'mapping_id' => dt('Mapping ID'),
          'project_id' => dt('Project ID'),
          'project_label' => dt('Project label'),
          'template_id' => dt('Template ID'),
          'template_label' => dt('Template label'),
          'content_type' => dt('Content type'),
        ],
      ],
    ],
  ];
  $commands['gathercontent-list-status'] = [
    'aliases' => [
      'gc-ls',
    ],
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
    'description' => dt('Lists the node status definitions.'),
    'required-arguments' => FALSE,
    'arguments' => [
      'project_id' => dt('GatherContent project ID. Use: gathercontent-list-mappings'),
    ],
    'engines' => [
      'outputformat' => [
        'default' => 'table',
        'pipe-format' => 'json',
        'output-data-type' => 'format-table',
        'field-labels' => [
          'status_id' => dt('Status ID'),
          'status_label' => dt('Status label'),
        ],
      ],
    ],
  ];
  $commands['gathercontent-import'] = [
    'aliases' => [
      'gc-i',
    ],
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
    'description' => dt('Import content from GatherContent site.'),
    'required-arguments' => FALSE,
    'arguments' => [
      'mapping_id' => dt('The drupal side content mapping ID. Use: gathercontent-list-mappings'),
      'node_update_method' => dt("Three choices: always_create, update_if_not_changed, always_update (this is the default)"),
      'parent_menu_item' => dt("Parent menu item. E.g.: Create under 'My account' menu, use: 'account:user.page'"),
      'status_id' => dt('Change the document status on GC side. Use: gathercontent-list-status'),
    ],
    'options' => [
      'publish' => array(
        'description' => dt('Use --publish or --no-publish.'),
        'required' => FALSE,
        'hidden' => FALSE,
      ),
    ],
    'engines' => [
      'outputformat' => [
        'default' => 'table',
        'pipe-format' => 'json',
        'output-data-type' => 'format-table',
        'field-labels' => [
          'id' => dt('ID'),
          'item_name' => dt('Item name'),
          'node_status' => dt('Node status'),
          'import_status' => dt('Import status'),
        ],
      ],
    ],
  ];
  return $commands;
}