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

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 5948 to 5970

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