$stmnt=$connection->query("SELECT * FROM `".$this->table_name."` WHERE `request_hash` = ? AND `connector_id` = ? AND `cached_until` = ?",array($hash,$connector_id,$today));
$connection->query("UPDATE `{$this->table_name}` set `status`=?,`reply`=?,`reply_date`=?,`scheduled_date`=?,`cached_until`=?,`retry_count`=? where `cid`=?",[$status,$reply,$reply_date,$scheduled_date,$cache_date,$retrycount,$id]);
}
}
/**
* Returns the queued calls which are ready for processing.
*
* @return array
* The array consists of the call ids
*/
publicfunctiongetQueuedCallIds(){
$call_ids=array();
$result=\Drupal::database()->query("
select cid from {$this->table_name}
where (status = 'INIT' OR status = 'RETRY')
and (DATE(scheduled_date) < NOW() or scheduled_date is NULL)
ORDER BY scheduled_date ASC");
if($result){
while($dataset=$result->fetch_object()){
$call_ids[]=$dataset->cid;
}
}
return$call_ids;
}
publicfunctionloadCall($call_id,$core){
$stmt=\Drupal::database()->query("SELECT * FROM `".$this->table_name."` WHERE `cid` = ? LIMIT 1",[$call_id]);