public function SystemQueue::createItem

cis7 system.queue.inc public SystemQueue::createItem($data)
cle7 system.queue.inc public SystemQueue::createItem($data)
elmsmedia7 system.queue.inc public SystemQueue::createItem($data)
icor7 system.queue.inc public SystemQueue::createItem($data)
meedjum_blog7 system.queue.inc public SystemQueue::createItem($data)
mooc7 system.queue.inc public SystemQueue::createItem($data)

Add a queue item and store it directly to the queue.

Parameters

$data: Arbitrary data to be associated with the new task in the queue.

Return value

TRUE if the item was successfully created and was (best effort) added to the queue, otherwise FALSE. We don't guarantee the item was committed to disk etc, but as far as we know, the item is now in the queue.

Overrides DrupalQueueInterface::createItem

File

modules/system/system.queue.inc, line 210
Queue functionality.

Class

SystemQueue
Default queue implementation.

Code

public function createItem($data) {
  // During a Drupal 6.x to 7.x update, drupal_get_schema() does not contain
  // the queue table yet, so we cannot rely on drupal_write_record().
  $query = db_insert('queue')->fields(array(
    'name' => $this->name,
    'data' => serialize($data),
    
    // We cannot rely on REQUEST_TIME because many items might be created
    // by a single request which takes longer than 1 second.
    'created' => time(),
  ));
  return (bool) $query->execute();
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.