Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource 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 4191 to 4202

Definition

 
function collection_cleanup_inaccessible_resources($collection)
    {
    global 
$userref;

    
$editable_states array_column(get_editable_states($userref), 'id');
    
sql_query("DELETE a 
                FROM   collection_resource AS a 
                INNER JOIN resource AS b 
                ON a.resource = b.ref 
                WHERE  a.collection = '" 
$collection "' 
                AND b.archive NOT IN ( '" 
implode("', '"$editable_states) . "' );");
    }

This article was last updated 28th November 2020 23:05 Europe/London time based on the source file dated 25th November 2020 10:35 Europe/London time.