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

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 3509 to 3529

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 14th December 2024 10:35 Europe/London time based on the source file dated 12th December 2024 10:30 Europe/London time.