Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

remove_all_resources_from_collection()

Parameters

ColumnTypeDefaultDescription
$ref

Location

include/collections_functions.php lines 3779 to 3794

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 15th December 2024 20:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.