is_featured_collection_category_by_children()

Description

Check if a collection is a featured collection category by checking if the collection has been used as a parent. This
function will make a DB query to find this out, it does not use existing structures.

Normally a featured collection is a category if it has no resources. In some circumstances, when it's impossible to
determine whether it should be or not, relying on children is another approach.

Parameters

ColumnTypeDefaultDescription
$c_ref integer Collection ID

Return

boolean

Location

include/collections_functions.php lines 5308 to 5323

Definition

 
function is_featured_collection_category_by_children(int $c_ref)
{
    
$found_ref ps_value(
        
"SELECT DISTINCT c.ref AS `value`
             FROM collection AS c
        LEFT JOIN collection AS cc ON c.ref = cc.parent
            WHERE c.`type` = ?
              AND c.ref = ?
         GROUP BY c.ref
           HAVING count(DISTINCT cc.ref) > 0"
,
        array(
"s",COLLECTION_TYPE_FEATURED,"i",$c_ref),
        
0
    
);

    return 
$found_ref 0;
}

This article was last updated 25th April 2025 21:35 Europe/London time based on the source file dated 23rd April 2025 16:25 Europe/London time.