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

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 24th April 2024 16:35 Europe/London time based on the source file dated 19th April 2024 15:45 Europe/London time.