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 2833 to 2845

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 1st December 2020 23:35 Europe/London time based on the source file dated 1st December 2020 11:10 Europe/London time.