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

Description

Returns a list of fields with refs matching the supplied field refs.

Parameters

ColumnTypeDefaultDescription
$field_refs array Array of field refs

Return

array

Location

include/resource_functions.php lines 8198 to 8227

Definition

 
function get_fields($field_refs)
    {
    if(!
is_array($field_refs))
        {
        
trigger_error("\$field_refs passed to get_fields() is not an array.");
        }

    if (
count($field_refs) === 0)
        {
        return array();
        }

    
$fields=ps_query("
        SELECT " 
columns_in("resource_type_field","rtf") . ", t.name AS tab_name
          FROM resource_type_field rtf
          LEFT JOIN tab t ON t.ref=rtf.tab          
         WHERE rtf.ref IN (" 
ps_param_insert(count($field_refs)) . ")
      ORDER BY rtf.order_by"
ps_param_fill($field_refs,"i"),"schema");

    
$return = array();
    foreach(
$fields as $field)
        {
        if(
metadata_field_view_access($field['ref']))
            {
            
$return[] = $field;
            }
        }

    return 
$return;
    }

This article was last updated 4th December 2024 09:05 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.