Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 22nd May 2024 15:35 Europe/London time based on the source file dated 14th May 2024 18:25 Europe/London time.