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

collection_cleanup_inaccessible_resources()

Description

Delete any resources from collection moved out of users archive status permissions by other users

Parameters

ColumnTypeDefaultDescription
$collection integer ID of collection

Return

void

Location

include/collections_functions.php lines 5273 to 5291

Definition

 
function collection_cleanup_inaccessible_resources($collection)
    {
    global 
$userref;

    
$editable_states array_column(get_editable_states($userref), 'id');
    
$count_editable_states count($editable_states);

    if(
$count_editable_states === 0)
        {
        return;
        }

    
ps_query("DELETE a 
                FROM   collection_resource AS a 
                INNER JOIN resource AS b 
                ON a.resource = b.ref 
                WHERE  a.collection = ? 
                AND b.archive NOT IN ("
ps_param_insert($count_editable_states) .")"array_merge(['i'$collection], ps_param_fill($editable_states'i')));
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.