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

Description

Get all resource_type->resource-type_field associations

Parameters

ColumnTypeDefaultDescription
$fields array [] Optional array of resource_type_field data returned by get_resource_type_fields()

Return

array Array with resource_type_field ID as keys and arrays of resource_type IDs as values

Location

include/config_functions.php lines 1540 to 1561

Definition

 
function get_resource_type_field_resource_types(array $fields = [])
    {
    
$field_restypes = [];
    
$allrestypes array_column(get_resource_types("",false,true,true),"ref");
    if(
count($fields)==0)
        {
        
$fields get_resource_type_fields();
        }

    foreach(
$fields as $field)
        {
        if(
$field["global"]==1)
            {
            
$field_restypes[$field["ref"]] = $allrestypes;
            }
        else
            {
            
$field_restypes[$field["ref"]] = explode(",",(string) $field["resource_types"]);
            }
        }
    return 
$field_restypes;
    }

This article was last updated 8th December 2024 20:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.