Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 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 19th March 2024 03:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.