Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

remove_all_resources_from_collection()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/collections_functions.php lines 3750 to 3765

Definition

 
function remove_all_resources_from_collection($ref){

    
$collection_type=ps_value("select type value from collection where ref=?",array("i",$ref),"");
    
    if (
$collection_type != COLLECTION_TYPE_SELECTION) {
        
$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 24th May 2024 11:05 Europe/London time based on the source file dated 16th May 2024 18:10 Europe/London time.