Collections functions
General functions
Render functions
Theme permission functions
Resource functions

addAnnotationNodes()

Description

Add relations between annotation and nodes

Parameters

ColumnTypeDefaultDescription
$annotation_ref integer The annotation ID in ResourceSpace
$nodes array List of node structures {@see get_nodes()}. Only the "ref" property is required.

Return

boolean

Location

include/annotation_functions.php lines 473 to 493

Definition

 
function addAnnotationNodes($annotation_ref, array $nodes)
    {
    if(
=== count($nodes))
        {
        return 
false;
        }

    
$query_insert_values '';
    
$parameters = [];

    foreach(
$nodes as $node)
        {
        
$query_insert_values .= ',(?, ?)';
        
$parameters array_merge($parameters, ['i'$annotation_ref'i'$node['ref']]);
        }
    
$query_insert_values substr($query_insert_values1);

    
ps_query("INSERT INTO annotation_node (annotation, node) VALUES  {$query_insert_values}"$parameters);

    return 
true;
    }

This article was last updated 25th May 2022 04:35 Europe/London time based on the source file dated 1st February 2022 16:00 Europe/London time.