Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_featured_collection_ref_by_name()

Description

Find existing featured collection ref using its name and parent

Parameters

ColumnTypeDefaultDescription
$name string Featured collection name to search by
$parent null|integer The featured collection parent

Return

null|integer

Location

include/collections_functions.php lines 5902 to 5924

Definition

 
function get_featured_collection_ref_by_name(string $name$parent)
    {
    if(!
is_null($parent) && !is_int($parent))
        {
        return 
null;
        }

    
$sql="SELECT ref AS `value` FROM collection WHERE `name` = ? AND `type` = ? AND ";
    
$params=array("s",trim($name),"s",COLLECTION_TYPE_FEATURED);

    if (
is_null($parent))
        {
        
$sql.="parent is null";
        }
    else
        {
        
$sql.="parent = ?";
        
$params[]="i";$params[]=$parent;
        }
    
$ref ps_value($sql,$params,null,"featured_collections");

    return 
is_null($ref) ? null : (int) $ref;
    }

This article was last updated 19th March 2024 08:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.