52 return $this->db->insertData($insert) !==
false;
63 ->andWhere($select->expr()->isNull(
'worker'))
64 ->orderBy(
'id',
'ASC')
67 $row = $this->db->getDataRow($select);
76 ->andWhere($update->compare(
'id',
'=', $row->id,
ELGG_VALUE_ID))
77 ->andWhere($update->expr()->isNull(
'worker'));
79 if ($this->db->updateData($update,
true) !== 1) {
89 return unserialize($row->data);
107 $select->select(
'COUNT(*) AS total')
110 $result = $this->db->getDataRow($select);
static table(string $table)
Returns a QueryBuilder for updating data in a given table.
if(!$user||!$user->canDelete()) $name
clear()
{Clear all items from the queue.void}
trait TimeUsing
Adds methods for setting the current time (for testing)
static intoTable(string $table)
Returns a QueryBuilder for inserting data in a given table.
dequeue()
{Remove an item from the queue.mixed}
getCurrentTime($modifier= '')
Get the (cloned) time.
FIFO queue that uses the database for persistence.
__construct(protected string $name, protected\Elgg\Database $db)
Create a queue.
foreach($recommendedExtensions as $extension) if(empty(ini_get('session.gc_probability'))||empty(ini_get('session.gc_divisor'))) $db
static fromTable(string $table)
Returns a QueryBuilder for deleting data from a given table.
size()
{Get the size of the queue.int}
const ELGG_VALUE_TIMESTAMP
enqueue($item)
{Add an item to the queue.Item to add to queue bool}
static fromTable(string $table, string $alias=null)
Returns a QueryBuilder for selecting data from a given table.