You are here

function pmpapi_flush_delete_queue in Public Media Platform API Integration 7

Flushes the PMPAPI_DELETE_QUEUE DrupalQueue

1 call to pmpapi_flush_delete_queue()
pmpapi_cron in ./pmpapi.module
Implements hook_cron().

File

./pmpapi.module, line 207
Creates basic calls to the PMP API.

Code

function pmpapi_flush_delete_queue() {
  $queue = DrupalQueue::get('PMPAPI_DELETE_QUEUE');
  while ($item = $queue
    ->claimItem()) {
    if (!empty($item->data['guid'])) {
      $queue
        ->releaseItem($item);
      pmpapi_remove($item->data['guid']);
    }
  }
}