Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

remove_all_resources_from_collection()

Description

Remove all resources from a collection

Parameters

ColumnTypeDefaultDescription
$ref integer The collection in question

Return

void

Location

include/collections_functions.php lines 2561 to 2573

Definition

 
function remove_all_resources_from_collection($ref){
    
// abstracts it out of save_collection()
    
$removed_resources sql_array('SELECT resource AS value FROM collection_resource WHERE collection = ' escape_check($ref) . ';');

    
collection_log($refLOG_CODE_COLLECTION_REMOVED_ALL_RESOURCES0);
    foreach(
$removed_resources as $removed_resource_id)
        {
        
collection_log($ref'r'$removed_resource_id' - Removed all resources from collection ID ' $ref);
        }

    
sql_query('DELETE FROM collection_resource WHERE collection = ' escape_check($ref));
    
sql_query("DELETE FROM external_access_keys WHERE collection='" escape_check($ref) . "'");
    }    

This article was last updated 10th July 2020 19:35 Europe/London time based on the source file dated 9th July 2020 17:22 Europe/London time.