function tripal_get_remote_field_formatters

3.x tripal_ws.api.inc tripal_get_remote_field_formatters($site_id, $bundle_accession, $field_accession)

Retrieves the list of download formatters for a remote field.

All Tripal fields support the abilty for inclusion in files that can downloaded. This function is used to identify what formatters these fields are appropriate for. If those download formatter classes exist on this site then the field can be used with that formatter.

Parameters

$site_id: The numeric site ID for the remote Tripal site.

$bundle_accession: The controlled vocabulary term accession for the content type on the remote Tripal site.

$field_accession: The controlled vocabulary term accession for the property (i.e. field) of the Class (i.e. content type).

Return value

An array of field downloader class names that are compoatible with the field and which exist on this site.

Related topics

1 call to tripal_get_remote_field_formatters()
TripalEntityCollection::setFormatters in tripal/includes/TripalEntityCollection.inc
Retrieves the list of appropriate download formatters for the basket.

File

tripal_ws/api/tripal_ws.api.inc, line 894
This file provides the Tripal Web Services API: a set of functions for interacting with the Tripal Web Services.

Code

function tripal_get_remote_field_formatters($site_id, $bundle_accession, $field_accession) {

  $flist = array();

  // Get the site documentation (loads from cache if already retrieved).
  $site_doc = tripal_get_remote_API_doc($site_id);
  $property = tripal_get_remote_field_doc($site_id, $bundle_accession, $field_accession);
  if (!$property) {
    return $flist;
  }

  $formatters = $property['tripal_formatters'];
  foreach ($formatters as $formatter) {
    if (tripal_load_include_downloader_class($formatter)) {
      $flist[$formatter] = $formatter::$full_label;
    }
  }
  return $flist;
}