Collections functions
General functions
Render functions
Theme permission functions
Resource functions

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 5638 to 5650

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 4th October 2022 12:05 Europe/London time based on the source file dated 4th October 2022 09:50 Europe/London time.