Collections functions
General functions
Render functions
Theme permission functions
Resource functions

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 5320 to 5330

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 9th June 2023 19:05 Europe/London time based on the source file dated 8th June 2023 10:25 Europe/London time.