Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 5803 to 5815

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 December 2024 08:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.