37 parent::__construct($name, $db);
46 $delay = (int) $this->config->notifications_queue_delay;
49 return parent::dequeue();
56 ->andWhere($select->expr()->isNull(
'worker'))
57 ->andWhere($select->compare(
'timestamp',
'<', $this->getCurrentTime(
"-{$delay} seconds")->getTimestamp(),
ELGG_VALUE_TIMESTAMP))
58 ->orderBy(
'id',
'ASC')
61 $row = $this->db->getDataRow($select);
70 ->andWhere($update->compare(
'id',
'=', $row->id,
ELGG_VALUE_ID))
71 ->andWhere($update->expr()->isNull(
'worker'));
73 if ($this->db->updateData($update,
true) !== 1) {
83 return unserialize($row->data);
static table(string $table)
Returns a QueryBuilder for updating data in a given table.
dequeue()
Remove an item from the queue.mixed
__construct(string $name,\Elgg\Database $db,\Elgg\Config $config)
Create a queue.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH)!== '/') if(file_exists(elgg_get_root_path(). 'robots.txt'))
Set robots.txt.
if(!$user||!$user->canDelete()) $name
FIFO queue that uses the database for persistence.
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.
const ELGG_VALUE_TIMESTAMP
static fromTable(string $table, string $alias=null)
Returns a QueryBuilder for selecting data from a given table.
Database queue for notifications.