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 1467 to 1488

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 27th April 2024 12:35 Europe/London time based on the source file dated 18th April 2024 17:15 Europe/London time.