Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 3005 to 3017

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($refLOG_CODE_COLLECTION_REMOVED_RESOURCE$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 12th May 2021 06:05 Europe/London time based on the source file dated 10th May 2021 09:15 Europe/London time.