Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 5285 to 5295

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 21st May 2024 21:35 Europe/London time based on the source file dated 16th May 2024 18:10 Europe/London time.