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

is_parent_node()

Description

Checks whether a node is parent to other nodes or not

Parameters

ColumnTypeDefaultDescription
$ref int Node ref
$active_only bool false: bool { ifis_null$ref Check only for active (children) nodes

Location

include/node_functions.php lines 456 to 468

Definition

 
function is_parent_node($refbool $active_only false): bool
    
{
    if(
is_null($ref))
        {
        return 
false;
        }

    
$query $active_only
        
'SELECT exists (SELECT ref from node WHERE parent = ? AND active = 1) AS `value`'
        
'SELECT exists (SELECT ref from node WHERE parent = ?) AS `value`';

    return 
ps_value($query, ['i'$ref], 0) > 0;
    }

This article was last updated 9th November 2024 17:05 Europe/London time based on the source file dated 28th October 2024 11:15 Europe/London time.