unrelate_all_collection()

Description

Un-relate all resources in a collection

Parameters

ColumnTypeDefaultDescription
$collection integer ID of collection
$checkperms true

Return

boolean

Location

include/collections_functions.php lines 4904 to 4913

Definition

 
function unrelate_all_collection($collection$checkperms true)
{
    if (!
is_int_loose($collection) || ($checkperms && !allow_multi_edit($collection))) {
        return 
false;
    }

    
ps_query('DELETE FROM resource_related WHERE `resource` IN (SELECT `resource` FROM collection_resource WHERE collection = ?) AND `related` IN (select `resource` FROM collection_resource WHERE collection = ?)', array('i'$collection'i'$collection));

    return 
true;
}

This article was last updated 13th July 2025 11:05 Europe/London time based on the source file dated 7th July 2025 14:35 Europe/London time.