Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 1490 to 1511

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 29th May 2024 09:35 Europe/London time based on the source file dated 23rd May 2024 18:05 Europe/London time.