Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

get_resource_data_batch()

Description

get_resource_data_batch - get data from resource table for all resource IDs

Parameters

ColumnTypeDefaultDescription
$refs mixed - array of resource IDs

Return

array

Location

include/resource_functions.php lines 417 to 431

Definition

 
function get_resource_data_batch($refs)
    {
    global 
$get_resource_data_cache;
    
truncate_cache_arrays();
    
$resids array_filter($refs,function($id){return (string)(int)$id==(string)$id;});
    
$resdata=sql_query("SELECT *,mapzoom,lock_user FROM resource WHERE ref IN ('" implode("','",$resids)  . "')");
    
// Create array with resource ID as index
    
$resource_data = array();
    foreach(
$resdata as $resdatarow)
       {
       
$resource_data[$resdatarow["ref"]] = $resdatarow;
       
$get_resource_data_cache[$resdatarow["ref"]] = $resdatarow;
       }
    return 
$resource_data;
    }

This article was last updated 22nd April 2021 23:35 Europe/London time based on the source file dated 20th April 2021 10:20 Europe/London time.