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_with_data()

Description

Get all resources in a collection without checking permissions or filtering by workflow states.
This is useful when you want to get all the resources for further subprocessing (@see render_selected_collection_actions()
as an example)

Parameters

ColumnTypeDefaultDescription
$ref integer Collection ID

Return

array

Location

include/collections_functions.php lines 312 to 335

Definition

 
function get_collection_resources_with_data($ref)
    {
    if(!
is_numeric($ref))
        {
        return array();
        }

    
$result ps_query("
            SELECT r.*
              FROM collection_resource AS cr
        RIGHT JOIN resource AS r ON cr.resource = r.ref
             WHERE cr.collection = ?
          ORDER BY cr.sortorder ASC , cr.date_added DESC , cr.resource DESC
    "
,
    array(
"i",$ref)
    );

    if(!
is_array($result))
        {
        return array();
        }

    return 
$result;
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.