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

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 471 to 491

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 4th December 2024 09:05 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.