You are here

function entityqueue_queue_create in Entityqueue 7

Constructs a new EntityQueue object, without saving it to the database.

Parameters

array $values: An array of queue properties. Defaults to an empty array.

Return value

EntityQueue|false An EntityQueue object, or FALSE if creation fails.

See also

EntityQueue

1 call to entityqueue_queue_create()
entityqueue_queue_save in ./entityqueue.module
Saves a queue.
1 string reference to 'entityqueue_queue_create'
entityqueue_schema in ./entityqueue.install
Implements hook_schema().

File

./entityqueue.module, line 125
Allows users to collect entities in arbitrarily ordered lists.

Code

function entityqueue_queue_create($values = array()) {
  $values = (array) $values;

  // Add default properties if they are not set.
  $values += array(
    'is_new' => TRUE,
    'language' => language_default()->language,
    'export_type' => EXPORT_IN_CODE,
  );
  $queue = new EntityQueue($values);

  // Invoke the queue handler in order to allow it to alter the created queue.
  entityqueue_get_handler($queue)
    ->create();
  return $queue;
}