Collections functions
General functions
Render 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 3618 to 3630

Definition

 
function remove_all_resources_from_collection($ref){
    
// abstracts it out of save_collection()
    
$removed_resources ps_array("SELECT resource AS value FROM collection_resource WHERE collection = ?",array("i",$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);
        }

    
ps_query("DELETE FROM collection_resource WHERE collection = ?",array("i",$ref));
    
ps_query("DELETE FROM external_access_keys WHERE collection = ? AND upload!=1",array("i",$ref));
    }    

This article was last updated 5th October 2022 03:05 Europe/London time based on the source file dated 4th October 2022 09:50 Europe/London time.