commerce_amws-8.x-1.x-dev/modules/order/commerce_amws_order.module
modules/order/commerce_amws_order.module
<?php
/**
* @file
* Provides functionality for the Commerce Amazon MWS Order module.
*/
/**
* Constants.
*/
/**
* The name of the logger channel to use throughout this module.
*
* @I Use the logger service everywhere and remove channel name constant
* type : task
* priority : low
* labels : coding-standards
*/
const COMMERCE_AMWS_ORDER_LOGGER_CHANNEL = 'commerce_amws_order';
/**
* Hooks.
*/
/**
* Implements hook_cron().
*/
function commerce_amws_order_cron() {
\Drupal::service('commerce_amws_order.hook.cron')->import();
commerce_amws_order_cron__purge();
}
/**
* Callbacks.
*/
/**
* Stub implementation of hook_cron() for purging orders.
*/
function commerce_amws_order_cron__purge() {
$config = \Drupal::service('config.factory')->get('commerce_amws_order.settings');
if (!$config->get('purge.cron.status')) {
return;
}
$options = [
'interval' => (int) $config->get('purge.interval'),
'limit' => (int) $config->get('purge.cron.limit'),
];
\Drupal::service('commerce_amws_order.order_purger')->purge($options, FALSE);
}
