Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_collection_resources()

Description

Returns all resources in collection

Parameters

ColumnTypeDefaultDescription
$collection int ID of collection being requested

Return

array|boolean

Location

include/collections_functions.php lines 300 to 323

Definition

 
function get_collection_resources($collection)
    {
    global 
$userref;

    
# For many cases (e.g. when displaying a collection for a user) a search is used instead so permissions etc. are honoured.
    
if(!is_int_loose($collection))
        {
        return 
false;
        }

    
# Check if review collection if so delete any resources moved out of users archive status permissions by other users
    
if((string)$collection == "-".$userref)
        {
        
collection_cleanup_inaccessible_resources($collection);
        }
    
    
$plugin_collection_resources=hook('replace_get_collection_resources'"", array($collection));
    if(
is_array($plugin_collection_resources))
        {
        return 
$plugin_collection_resources;
        }

    return 
ps_array("SELECT resource value FROM collection_resource WHERE collection = ? ORDER BY sortorder ASC, date_added DESC, resource DESC",array("i",$collection)); 
    }

This article was last updated 29th May 2022 07:05 Europe/London time based on the source file dated 26th May 2022 11:20 Europe/London time.