Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

job_queue_update()

Parameters

ColumnTypeDefaultDescription
$ref
$job_data array
$newstatus ""
$newtime ""
$priority null

Location

include/job_functions.php lines 58 to 90

Definition

 
function job_queue_update($ref,$job_data=array(),$newstatus=""$newtime=""$priority=null)
    {
    
$update_sql = array();
    
$parameters = array();
    if (
count($job_data) > 0)
        {
        
$update_sql[] = "job_data = ?";
        
$parameters array_merge($parameters,array("s",json_encode($job_data)));
        } 
    if(
$newtime!="")
        {
        
$update_sql[] = "start_date = ?";
        
$parameters array_merge($parameters,array("s",$newtime));
        }
    if(
$newstatus!="")
        {
        
$update_sql[] = "status = ?";
        
$parameters array_merge($parameters,array("i",$newstatus));
        }
    if(
is_int_loose($priority))
        {
        
$update_sql[] = "priority = ?";
        
$parameters array_merge($parameters,array("i",(int)$priority));
        }
    if(
count($update_sql) == 0)
        {
        return 
false;
        }

    
$sql "UPDATE job_queue SET " implode(",",$update_sql) . " WHERE ref = ?";
    
$parameters array_merge($parameters,array("i",$ref));
    
ps_query($sql,$parameters);
    }

This article was last updated 13th December 2024 08:35 Europe/London time based on the source file dated 18th October 2024 11:40 Europe/London time.