Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_collections_resource_count()

Description

Get collection total resource count for a list of collections


note that the returned array might NOT contain keys for all the input IDs (e.g validation failed).

Parameters

ColumnTypeDefaultDescription
$refs array List of collection IDs

Return

array Returns table of collections and their total resource count (taking into account access controls). Please

Location

include/search_functions.php lines 3251 to 3271

Definition

 
function get_collections_resource_count(array $refs)
    {
    
$return = [];

    foreach(
$refs as $ref)
        {
        if(!(
is_int_loose($ref) && $ref 0))
            {
            continue;
            }

        
$colresults do_search("!collection{$ref}"'''relevance''0',[0,0]);
        if(!isset(
$colresults["total"]))
            {
            continue;
            }
        
$return[$ref] = $colresults["total"];
        }
    
    return 
$return;
    }

This article was last updated 19th March 2024 05:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.