You are here

function commerce_cart_expiration_drush_command in Commerce Cart Expiration 7

Implements hook_drush_command().

File

./commerce_cart_expiration.drush.inc, line 11
Drush integration for the Commerce cart expiration module.

Code

function commerce_cart_expiration_drush_command() {
  $items = array();
  $items['commerce-cart-expiration-clean-orders'] = array(
    'description' => dt('Deletes commerce orders that are in a cart state.'),
    'arguments' => array(
      'interval' => dt('Time span (in seconds) until shopping carts are considered expired. Defaults to the interval specified in the default Rule provided by this module.'),
    ),
    'options' => array(
      'limit' => dt("Number of orders to delete at a time. Set to 'default' to use the limit specified in the default Rule provided by this module."),
    ),
    'examples' => array(
      'drush cce-co' => "Delete all cart orders that weren't modified in the last time interval specified in the default Rule provided by this module.",
      'drush cce-co 3600' => "Delete all cart orders that weren't modified in the last hour.",
      'drush cce-co 3600 --limit=200' => "Delete 200 cart orders that weren't modified in the last hour.",
      'drush cce-co 3600 --limit=default' => "Delete X cart orders that weren't modified in the last hour when X is the value specified in the default Rule provided by this module.",
    ),
    'aliases' => array(
      'cce-co',
    ),
  );
  return $items;
}