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 3289 to 3309

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 22nd July 2024 21:35 Europe/London time based on the source file dated 17th July 2024 15:30 Europe/London time.