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_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 278 to 301

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 ASC",array("i",$collection)); 
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.