function BatchQueue::claimItem

Overrides SystemQueue::claimItem().

Unlike SystemQueue::claimItem(), this method provides a default lease time of 0 (no expiration) instead of 30. This allows the item to be claimed repeatedly until it is deleted.

Overrides SystemQueue::claimItem

File

includes/batch.queue.inc, line 28

Class

BatchQueue
Defines a batch queue.

Code

public function claimItem($lease_time = 0) {
    $item = db_query_range('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, array(
        ':name' => $this->name,
    ))
        ->fetchObject();
    if ($item) {
        $item->data = unserialize($item->data);
        return $item;
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.