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

Description

Get all resource nodes associated for a specific resource type field.

Parameters

ColumnTypeDefaultDescription
$ref integer Resource type field ID

Return

Generator

Location

include/node_functions.php lines 1503 to 1531

Definition

 
function get_resources_nodes_by_rtf(int $ref)
    {
    
$offset null;
    do
        {
        
$rows 1000;
        
$sql_limit sql_limit($offset$rows);
        
$offset += $rows;

        
$parameters= [];
        
$sql columns_in("node","n");
        
add_sql_node_language($sql,$parameters,"n");
        
        
$parameters array_merge($parameters,['i'$ref]);
        
$data ps_query(
               
"SELECT " $sql "
                  FROM resource_node AS rn
            INNER JOIN node AS n ON rn.node = n.ref AND n.resource_type_field = ?
            INNER JOIN resource AS r ON rn.resource = r.ref
            
$sql_limit",
            
$parameters            
        
);
        foreach(
$data as $page_data)
            {
            yield 
$page_data;
            }
        }
    while (!empty(
$data) && count($data) === $rows);
    }

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