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

Description

Get the total number of nodes for a specific field

Parameters

ColumnTypeDefaultDescription
$resource_type_field integer ID of the metadata field
$name string '' Filter by name of node

Return

integer

Location

include/node_functions.php lines 1861 to 1873

Definition

 
function get_nodes_count($resource_type_field$name '')
    {
    
$query="SELECT count(ref) AS `value` FROM node WHERE resource_type_field = ?";
    
$parameters=array("i",$resource_type_field);

    if(
'' != $name)
        {
        
$query .= " AND `name` LIKE ?";
        
$parameters[]="s";$parameters[]="%" $name "%";
        }

    return (int) 
ps_value($query,$parameters0);
    }

This article was last updated 11th December 2024 20:35 Europe/London time based on the source file dated 6th December 2024 12:00 Europe/London time.