Collections functions
General functions
Render functions
Theme permission 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 5783 to 5805

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 30th September 2022 16:05 Europe/London time based on the source file dated 22nd September 2022 11:00 Europe/London time.