Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource 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 257 to 280

Definition

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

    
$ref escape_check($ref);

    
$result sql_query("
            SELECT r.*
              FROM collection_resource AS cr
        RIGHT JOIN resource AS r ON cr.resource = r.ref
             WHERE cr.collection = '
{$ref}'
          ORDER BY cr.sortorder ASC , cr.date_added DESC , cr.resource DESC
    "
);

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

    return 
$result;
    }

This article was last updated 26th November 2020 03:35 Europe/London time based on the source file dated 25th November 2020 10:35 Europe/London time.