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 3748 to 3763

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 26th April 2024 07:05 Europe/London time based on the source file dated 25th April 2024 16:25 Europe/London time.