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_node()

Description

Get a specific node by ref

this parameter which is passed by reference
a value has been changed, for example after editing a node name. Set to false to not use cache.

Parameters

ColumnTypeDefaultDescription
$ref integer ID of the node
&$returned_node array
$cache bool true By default this function returns cached data. This may not be appropriate if called after
$returned_node array If a value does exist it will be returned through

Return

boolean

Location

include/node_functions.php lines 244 to 265

Definition

 
function get_node($ref, array &$returned_node$cache true)
    {
    if(
is_null($ref) || (trim($ref)=="") || >= $ref)
        {
        return 
false;
        }

    
$parameters= [];
    
$sql columns_in("node");
    
add_sql_node_language($sql,$parameters);    
    
$parameters[] = "i";$parameters[] = $ref;
    
$node  ps_query("SELECT " $sql " FROM node WHERE ref = ?",$parameters$cache "schema" "");

    if(
count($node)==0)
        {
        return 
false;
        }

    
$returned_node $node[0];

    return 
true;
    }

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.