Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 4622 to 4638

Definition

 
function is_featured_collection_category_by_children(int $c_ref)
    {
    
$sql sprintf(
          
"SELECT DISTINCT c.ref AS `value`
             FROM collection AS c
        LEFT JOIN collection AS cc ON c.ref = cc.parent
            WHERE c.`type` = %s
              AND c.ref = '%s'
         GROUP BY c.ref
           HAVING count(DISTINCT cc.ref) > 0"
,
        
COLLECTION_TYPE_FEATURED,
        
escape_check($c_ref)
    );
    
$found_ref sql_value($sql0);

    return (
$found_ref 0);
    }

This article was last updated 18th January 2021 11:05 Europe/London time based on the source file dated 13th January 2021 13:50 Europe/London time.