function commerce_bulk_cron in Commerce Bulk 8
Implements hook_cron().
File
- ./
commerce_bulk.module, line 163 - Contains commerce_bulk.module.
Code
function commerce_bulk_cron() {
// Anonymize orders example.
/*
$manager = \Drupal::entityTypeManager();
if ($anonymizer = $manager->getStorage('action')->load('commerce_bulk_order_zanonymize')) {
$fields = [
'ip_address',
'billing_profile',
'shipping_profile',
'data',
'mail',
'field_my_field',
];
$storage = $manager->getStorage('commerce_order');
$query = $storage->getQuery();
$query->accessCheck(FALSE);
// Select orders older than 365 days.
$query->condition('completed', \time() - (86400 * 365), '>');
$orders = $storage->loadMultiple($query->execute());
$anonymizer->getPlugin()->anonymizeEntities($orders, $fields);
}
*/
}